parseString

fun parseString(source: A_String, startPosition: Int, startLineNumber: Int, lexer: A_Lexer): A_Token

Attempt to parse string from the given string, starting at the given position, and treating it as starting at the given line number.

Return

The resulting token, if successful. Note that the size of the token's lexeme (A_Token.string) accurately conveys how many codepoints were consumed.

Parameters

source

The source to parse a string literal from.

startPosition

The one-based position at which to start parsing.

startLineNumber

What line to treat the first character as occurring on.

lexer

The A_Lexer responsible for creating this token, otherwise nil.

Throws

If a string token could not be parsed starting at the given position.