Crates.io | ruby-parser |
lib.rs | ruby-parser |
version | 0.0.0-dev1 |
source | src |
created_at | 2020-08-23 16:11:39.59661 |
updated_at | 2020-08-23 16:11:39.59661 |
description | A parser for the Ruby language |
homepage | |
repository | https://github.com/kenaniah/ruby-parser |
max_upload_size | |
id | 279866 |
size | 147,760 |
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
)