Class: Query::Parser::String
- Defined in:
- lib/query/parser/string.rb
Instance Method Summary collapse
- #backslash ⇒ Object
- #double_quote ⇒ Object
- #double_quoted_string ⇒ Object
- #root ⇒ Object
- #single_quote ⇒ Object
- #single_quoted_string ⇒ Object
Instance Method Details
#backslash ⇒ Object
14 15 16 |
# File 'lib/query/parser/string.rb', line 14 def backslash str("\\") end |
#double_quote ⇒ Object
6 7 8 |
# File 'lib/query/parser/string.rb', line 6 def double_quote str('"') end |
#double_quoted_string ⇒ Object
18 19 20 21 22 |
# File 'lib/query/parser/string.rb', line 18 def double_quoted_string double_quote.ignore << ( (backslash.ignore << double_quote) | (double_quote.absent << any) ).repeat << double_quote.maybe.ignore end |
#root ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/query/parser/string.rb', line 30 def root ( ( double_quoted_string | single_quoted_string | (Special.absent << any).repeat(1) ) << Special.present ).aka(:string) end |
#single_quote ⇒ Object
10 11 12 |
# File 'lib/query/parser/string.rb', line 10 def single_quote str("'") end |
#single_quoted_string ⇒ Object
24 25 26 27 28 |
# File 'lib/query/parser/string.rb', line 24 def single_quoted_string single_quote.ignore << ( (backslash.ignore << single_quote) | (single_quote.absent << any) ).repeat << single_quote.maybe.ignore end |