Class: Template::Parser::Template
- Inherits:
-
Language
- Object
- Language
- Template::Parser::Template
- Defined in:
- lib/template/parser/template.rb
Instance Method Summary collapse
- #backslash ⇒ Object
- #closing_curly_bracket ⇒ Object
- #code ⇒ Object
- #code_part ⇒ Object
- #opening_curly_bracket ⇒ Object
- #root ⇒ Object
- #text_character ⇒ Object
- #text_part ⇒ Object
Instance Method Details
#backslash ⇒ Object
18 19 20 |
# File 'lib/template/parser/template.rb', line 18 def backslash str('\\') end |
#closing_curly_bracket ⇒ Object
14 15 16 |
# File 'lib/template/parser/template.rb', line 14 def closing_curly_bracket str("}") end |
#code ⇒ Object
6 7 8 |
# File 'lib/template/parser/template.rb', line 6 def code ::Code::Parser::Code end |
#code_part ⇒ Object
22 23 24 |
# File 'lib/template/parser/template.rb', line 22 def code_part opening_curly_bracket << code << (closing_curly_bracket | any.absent) end |
#opening_curly_bracket ⇒ Object
10 11 12 |
# File 'lib/template/parser/template.rb', line 10 def opening_curly_bracket str("{") end |
#root ⇒ Object
35 36 37 38 |
# File 'lib/template/parser/template.rb', line 35 def root (code_part.aka(:code) | text_part.aka(:text)).repeat | str("").aka(:text).repeat(1, 1) end |
#text_character ⇒ Object
26 27 28 29 |
# File 'lib/template/parser/template.rb', line 26 def text_character (backslash.ignore << opening_curly_bracket) | (opening_curly_bracket.absent << any) end |
#text_part ⇒ Object
31 32 33 |
# File 'lib/template/parser/template.rb', line 31 def text_part text_character.repeat(1) end |