Class: CrossPlane::Lexer
- Inherits:
-
Object
- Object
- CrossPlane::Lexer
- Defined in:
- lib/crossplane/lexer.rb
Constant Summary collapse
- EXTERNAL_LEXERS =
{}
- NEWLINE =
"\n"
Instance Attribute Summary collapse
-
#filename ⇒ Object
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Lexer
constructor
A new instance of Lexer.
- #lex(*args) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Lexer
Returns a new instance of Lexer.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/crossplane/lexer.rb', line 13 def initialize(*args) args = args[0] || {} required = ['filename'] conflicts = [] requires = {} valid = { 'params' => [ 'filename', ] } content = CrossPlane.utils.validate_constructor(client: self, args: args, required: required, conflicts: conflicts, requires: requires, valid: valid) self.filename = content[:filename] end |
Instance Attribute Details
#filename ⇒ Object
Returns the value of attribute filename.
12 13 14 |
# File 'lib/crossplane/lexer.rb', line 12 def filename @filename end |
Instance Method Details
#lex(*args) ⇒ Object
29 30 31 32 33 |
# File 'lib/crossplane/lexer.rb', line 29 def lex(*args) tokens = _lex_file() _balance_braces(tokens) tokens end |