class Myst::Lexer
- Myst::Lexer
- Reference
- Object
Direct Known Subclasses
Defined in:
myst/syntax/lexer.crConstructors
Instance Method Summary
-
#advance_token
Move to a new token with a new buffer.
-
#brace_stack : Array(Char)
List of currently-unmatched braces in the source.
-
#brace_stack=(brace_stack : Array(Char))
List of currently-unmatched braces in the source.
-
#check_for_keyword
Attempt to lex the current buffer as a keyword.
-
#col : Int32
Current column number in the source.
-
#col=(col : Int32)
Current column number in the source.
- #consume_comment
- #consume_constant
- #consume_identifier
- #consume_numeric
- #consume_symbol_or_colon
- #consume_whitespace
-
#context_stack : Array(Context)
Stack of contexts that the lexer is within.
-
#context_stack=(context_stack : Array(Context))
Stack of contexts that the lexer is within.
- #current_brace : Char
- #current_char : Char
- #current_context
- #current_location
-
#current_token : Token
Token currently being parsed.
-
#current_token=(current_token : Token)
Token currently being parsed.
-
#finalize_token
Assign the tokens final value and add it to the consumed tokens list.
- #finished? : Bool
-
#last_char : Char
Current character in the source.
-
#last_char=(last_char : Char)
Current character in the source.
- #lex_all
- #peek_char : Char
-
#pop_brace(type : Symbol)
Attempts to pop the top bracing character from the stack, but only if it matches the given type.
- #pop_context
- #push_brace(type : Symbol)
- #push_context(context : Context)
-
#read_char(save_to_buffer = true) : Char
Consume a single character from the source.
-
#read_normal_token
Consume and store a single token from the source.
- #read_string_interp_token
- #read_string_token
- #read_token
-
#reader : Reader
Source code being lexed.
-
#reader=(reader : Reader)
Source code being lexed.
- #replace_escape_characters(raw)
-
#row : Int32
Current line number in the source.
-
#row=(row : Int32)
Current line number in the source.
- #skip_char : Char
-
#source_file : String
Full path to the source file used by this lexer.
-
#source_file=(source_file : String)
Full path to the source file used by this lexer.
- #token_is_empty?
-
#tokens : Array(Token)
List of tokens already parsed.
-
#tokens=(tokens : Array(Token))
List of tokens already parsed.
Constructor Detail
Instance Method Detail
Attempt to lex the current buffer as a keyword. If one is found, the token type will be set appropriately. If not, the token type will not be changed.
Stack of contexts that the lexer is within.
Attempts to pop the top bracing character from the stack, but only if it matches the given type. Returns false if the type does not match.
Full path to the source file used by this lexer. For STDIN and other
non-local input methods, this will be nil
.
Full path to the source file used by this lexer. For STDIN and other
non-local input methods, this will be nil
.