Lexer for Icon: converts a sequence of lines containing Icon code into a sequence of tokens, preserving location and source contents.
Limitations:
icon_lexer (line_generator, include_comments)
Generates tokens from a given line generator.
> every token := icon_lexer(["2 + 3"]) do write(token.kind, " ", token.text) INT_LIT 2 PLUS + INT_LIT 3 EOFX
lexer_token (kind, text, line_number, line_column)
Tokens represent individual elements in an Icon program, such as number literals, keywords or operators. The token record holds information about each token, including its type and position in the source file.