Class: DocRSpec::Parser
- Inherits:
-
Object
- Object
- DocRSpec::Parser
- Defined in:
- lib/doc_rspec/parser.rb
Defined Under Namespace
Classes: InternalError, SyntaxError
Constant Summary collapse
- COMMENT =
%r{\A \s* \# \s*}x
- EMPTY_LINE =
%r{\A \s* \#+ \s* \z}x
- EQUALS_OP =
%r{\s+ => \s+}x
- EXAMPLE_LINE =
%r{\A \s* \#+ \s+ (.*)}x
- START_EXAMPLE =
%r{\A \s* \#+ \s+ ```spec \s* (\# \s+)?(.*)?}x
- START_RDOC_COMMENT =
%r{\A \s* \#\#}x
- STOP_EXAMPLE =
%r{\A \s* \#+ \s+ ```}x
- STOP_RDOC_COMMENT =
%r{\A \s* [^#]* \z}x
Instance Attribute Summary collapse
-
#ast ⇒ Object
readonly
Returns the value of attribute ast.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Instance Method Summary collapse
Instance Attribute Details
#ast ⇒ Object (readonly)
Returns the value of attribute ast.
21 22 23 |
# File 'lib/doc_rspec/parser.rb', line 21 def ast @ast end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
21 22 23 |
# File 'lib/doc_rspec/parser.rb', line 21 def lines @lines end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
21 22 23 |
# File 'lib/doc_rspec/parser.rb', line 21 def state @state end |
Instance Method Details
#parse ⇒ Object
23 24 25 26 27 28 |
# File 'lib/doc_rspec/parser.rb', line 23 def parse lines.each_with_index do |line, lnb| parse_line(line, lnb.succ) end ast end |