Module: Coradoc::Parser::Asciidoc::Base
Instance Method Summary collapse
- #attribute_name ⇒ Object
- #attribute_value ⇒ Object
-
#digits ⇒ Object
rule(:inline_element) { text } rule(:text) { match(“”).repeat(1) }.
- #email ⇒ Object
-
#empty_line ⇒ Object
rule(:space) { match(‘s’) } rule(:space?) { spaces.maybe } rule(:spaces) { space.repeat(1) }.
- #endline ⇒ Object
-
#keyword ⇒ Object
def line_break match end.
- #line_ending ⇒ Object
- #newline ⇒ Object
- #space ⇒ Object
- #space? ⇒ Boolean
- #special_character ⇒ Object
- #text ⇒ Object
- #word ⇒ Object
- #words ⇒ Object
Instance Method Details
#attribute_name ⇒ Object
70 71 72 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 70 def attribute_name match("[a-zA-Z0-9_-]").repeat(1) end |
#attribute_value ⇒ Object
74 75 76 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 74 def attribute_value text | str("") end |
#digits ⇒ Object
rule(:inline_element) { text } rule(:text) { match(“”).repeat(1) }
54 55 56 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 54 def digits match("[0-9]").repeat(1) end |
#email ⇒ Object
66 67 68 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 66 def email word >> str("@") >> word >> str(".") >> word end |
#empty_line ⇒ Object
rule(:space) { match(‘s’) } rule(:space?) { spaces.maybe } rule(:spaces) { space.repeat(1) }
46 47 48 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 46 def empty_line match("^\n") end |
#endline ⇒ Object
21 22 23 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 21 def endline newline | any.absent? end |
#keyword ⇒ Object
def line_break
match["\r\n"]
end
33 34 35 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 33 def keyword (match("[a-zA-Z0-9_-]") | str(".")).repeat(1) end |
#line_ending ⇒ Object
17 18 19 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 17 def line_ending match("[\n]") end |
#newline ⇒ Object
25 26 27 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 25 def newline match["\r\n"].repeat(1) end |
#space ⇒ Object
9 10 11 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 9 def space match('\s').repeat(1) end |
#space? ⇒ Boolean
5 6 7 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 5 def space? space.maybe end |
#special_character ⇒ Object
78 79 80 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 78 def special_character match("^[*_:=-]") | str("[#") | str("[[") end |
#text ⇒ Object
13 14 15 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 13 def text match("[^\n]").repeat(1) end |
#word ⇒ Object
58 59 60 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 58 def word match("[a-zA-Z0-9_-]").repeat(1) end |
#words ⇒ Object
62 63 64 |
# File 'lib/coradoc/parser/asciidoc/base.rb', line 62 def words word >> (space? >> word).repeat end |