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
- #special ⇒ 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
22 23 24 25 26 |
# File 'lib/query/parser/string.rb', line 22 def double_quoted_string double_quote.ignore << ( (backslash.ignore << double_quote) | (double_quote.absent << any) ).repeat << double_quote.maybe.ignore end |
#root ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/query/parser/string.rb', line 34 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
28 29 30 31 32 |
# File 'lib/query/parser/string.rb', line 28 def single_quoted_string single_quote.ignore << ( (backslash.ignore << single_quote) | (single_quote.absent << any) ).repeat << single_quote.maybe.ignore end |
#special ⇒ Object
18 19 20 |
# File 'lib/query/parser/string.rb', line 18 def special str("...") | str("..") | Whitespace | Operator end |