Crates.io | ruby-lexer |
lib.rs | ruby-lexer |
version | 0.0.0-dev1 |
source | src |
created_at | 2020-07-21 04:21:40.005596 |
updated_at | 2020-07-21 04:21:40.005596 |
description | A parser for the Ruby language |
homepage | |
repository | https://github.com/kenaniah/ruby-lexer |
max_upload_size | |
id | 267471 |
size | 120,208 |
The goal of this project is to create a complete lexer for the Ruby language using parser combinators.
"\C-\C-\\n" # => "\n"
Token::Block
contains a list of statements (each item is considered to be a statement)Token::Expression
contains a list of tokens that make up an individual statement(2 + (puts "hi"; 4 - 8;;)) * 5
#hi
#=> -10
The Input
type can be extended to track a boolean field that denotes whether
the lexer's input is complete or partial (such as within IRB's REPL). Combinators
that may be partially completed (such as open strings, arrays, etc.) can additionally
return a Token::IncompleteInput
on the end of their token stream in partial mode
to signal that the token has not been completed by the end of the user's input.
I'm not yet sure if start / end tokens should be used for complex objects, but they may be helpful when dealing with partial inputs.
CMD QUOTE
)