Create a new instance of a lexer by reading from a string.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(toml_lexer), | intent(out) | :: | lexer |
Instance of the lexer |
||
character(kind=tfc, len=*), | intent(in) | :: | string |
String to read from |
subroutine new_lexer_from_string(lexer, string) !> Instance of the lexer type(toml_lexer), intent(out) :: lexer !> String to read from character(*, tfc), intent(in) :: string integer :: length length = len(string) lexer%pos = 0 lexer%buffer = 0 allocate(character(length) :: lexer%chunk) lexer%chunk(:length) = string call resize(lexer%stack) end subroutine new_lexer_from_string