Module: Antlers::VarLexeme
Constant Summary
Constants included from Lexeme
Instance Method Summary collapse
- #lexeme(segment:, raw:) ⇒ Object
-
#match? ⇒ Boolean
Variables are special and are matched by the lexer.
Methods included from Queries
user_defined_string?, wrapped_in?
Instance Method Details
#lexeme(segment:, raw:) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/lexemes/var_lexeme.rb', line 17 def lexeme(segment:, raw:, **) # String is already interpolated or not depending on user input on the template layer, now we store it without those template quotes. segment = segment[1..-2] if Queries.user_defined_string?(segment) return { raw_var: segment } if raw { var: segment } end |
#match? ⇒ Boolean
Variables are special and are matched by the lexer.
13 14 15 |
# File 'lib/lexemes/var_lexeme.rb', line 13 def match?(**) false end |