mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
b0d0c9f40d
This basically revertse9fca7668b
,d08da958b9
,d1fe1dcf8a
, and68eaf7b4d5
50 lines
983 B
Text
50 lines
983 B
Text
class ActionDispatch::Journey::Parser
|
|
options no_result_var
|
|
token SLASH LITERAL SYMBOL LPAREN RPAREN DOT STAR OR
|
|
|
|
rule
|
|
expressions
|
|
: expression expressions { Cat.new(val.first, val.last) }
|
|
| expression { val.first }
|
|
| or
|
|
;
|
|
expression
|
|
: terminal
|
|
| group
|
|
| star
|
|
;
|
|
group
|
|
: LPAREN expressions RPAREN { Group.new(val[1]) }
|
|
;
|
|
or
|
|
: expression OR expression { Or.new([val.first, val.last]) }
|
|
| expression OR or { Or.new([val.first, val.last]) }
|
|
;
|
|
star
|
|
: STAR { Star.new(Symbol.new(val.last)) }
|
|
;
|
|
terminal
|
|
: symbol
|
|
| literal
|
|
| slash
|
|
| dot
|
|
;
|
|
slash
|
|
: SLASH { Slash.new(val.first) }
|
|
;
|
|
symbol
|
|
: SYMBOL { Symbol.new(val.first) }
|
|
;
|
|
literal
|
|
: LITERAL { Literal.new(val.first) }
|
|
;
|
|
dot
|
|
: DOT { Dot.new(val.first) }
|
|
;
|
|
|
|
end
|
|
|
|
---- header
|
|
# :stopdoc:
|
|
|
|
require "action_dispatch/journey/parser_extras"
|