Class: ARST::Parser
- Inherits:
-
Parslet::Parser
- Object
- Parslet::Parser
- ARST::Parser
- Defined in:
- lib/arst/parser.rb
Overview
The parser for ARST.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.parse(input, options = {}) ⇒ Object
9 10 11 |
# File 'lib/arst/parser.rb', line 9 def self.parse(input, ={}) new.parse(input, ) end |
Instance Method Details
#indent(depth) ⇒ Object
19 20 21 |
# File 'lib/arst/parser.rb', line 19 def indent(depth) str(' ' * depth) end |
#node(depth) ⇒ Object
48 49 50 51 52 53 54 55 56 |
# File 'lib/arst/parser.rb', line 48 def node(depth) indent(depth) >> ( ( class_keyword | module_keyword ) >> newline.maybe >> dynamic { |soutce, context| node(depth+1).repeat(0) }.as(:children) | ( include_keyword | extend_keyword ) >> newline.maybe | newline ) end |