Sha256: 5dd388bdf348fe50f5df0629fc624885511226c91723a0c9b8c3a1d0175ba54d

Contents?: true

Size: 965 Bytes

Versions: 87

Compression:

Stored size: 965 Bytes

Contents

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('/') }
    ;
  symbol
    : SYMBOL             { Symbol.new(val.first) }
    ;
  literal
    : LITERAL            { Literal.new(val.first) }
    ;
  dot
    : DOT                { Dot.new(val.first) }
    ;

end

---- header

require 'action_dispatch/journey/parser_extras'

Version data entries

87 entries across 85 versions & 10 rubygems

Version Path
actionpack-4.2.11.3 lib/action_dispatch/journey/parser.y
actionpack-4.2.11.2 lib/action_dispatch/journey/parser.y
actionpack-5.0.7.2 lib/action_dispatch/journey/parser.y
actionpack-4.2.11.1 lib/action_dispatch/journey/parser.y
actionpack-5.0.7.1 lib/action_dispatch/journey/parser.y
actionpack-4.2.11 lib/action_dispatch/journey/parser.y
actionpack-5.0.7 lib/action_dispatch/journey/parser.y
actionpack-4.2.10 lib/action_dispatch/journey/parser.y
actionpack-4.2.10.rc1 lib/action_dispatch/journey/parser.y
actionpack-5.0.6 lib/action_dispatch/journey/parser.y
actionpack-5.0.6.rc1 lib/action_dispatch/journey/parser.y
actionpack-5.0.5 lib/action_dispatch/journey/parser.y
actionpack-5.0.5.rc2 lib/action_dispatch/journey/parser.y
actionpack-5.0.5.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.2.9 lib/action_dispatch/journey/parser.y
actionpack-4.2.9.rc2 lib/action_dispatch/journey/parser.y
actionpack-5.0.4 lib/action_dispatch/journey/parser.y
actionpack-5.0.4.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.2.9.rc1 lib/action_dispatch/journey/parser.y
actionpack-5.0.3 lib/action_dispatch/journey/parser.y