Sha256: b092712ee433b2c5f507cb2f6cfdbd9bc53b200109b6b7505e390398088aec8a

Contents?: true

Size: 961 Bytes

Versions: 30

Compression:

Stored size: 961 Bytes

Contents

class ActionDispatch::Journey::Parser

token SLASH LITERAL SYMBOL LPAREN RPAREN DOT STAR OR

rule
  expressions
    : expressions expression  { result = Cat.new(val.first, val.last) }
    | expression              { result = val.first }
    | or
    ;
  expression
    : terminal
    | group
    | star
    ;
  group
    : LPAREN expressions RPAREN { result = Group.new(val[1]) }
    ;
  or
    : expressions OR expression { result = Or.new([val.first, val.last]) }
    ;
  star
    : STAR       { result = Star.new(Symbol.new(val.last)) }
    ;
  terminal
    : symbol
    | literal
    | slash
    | dot
    ;
  slash
    : SLASH              { result = Slash.new('/') }
    ;
  symbol
    : SYMBOL             { result = Symbol.new(val.first) }
    ;
  literal
    : LITERAL            { result = Literal.new(val.first) }
  dot
    : DOT                { result = Dot.new(val.first) }
    ;

end

---- header

require 'action_dispatch/journey/parser_extras'

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
actionpack-4.0.13 lib/action_dispatch/journey/parser.y
actionpack-4.0.13.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.0.11.1 lib/action_dispatch/journey/parser.y
actionpack-4.0.12 lib/action_dispatch/journey/parser.y
actionpack-4.0.11 lib/action_dispatch/journey/parser.y
actionpack-4.0.10 lib/action_dispatch/journey/parser.y
actionpack-4.0.10.rc2 lib/action_dispatch/journey/parser.y
actionpack-4.0.10.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.0.9 lib/action_dispatch/journey/parser.y
actionpack-4.0.8 lib/action_dispatch/journey/parser.y
actionpack-4.0.7 lib/action_dispatch/journey/parser.y
actionpack-4.0.6 lib/action_dispatch/journey/parser.y
actionpack-4.0.6.rc3 lib/action_dispatch/journey/parser.y
actionpack-4.0.6.rc2 lib/action_dispatch/journey/parser.y
actionpack-4.0.6.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.0.5 lib/action_dispatch/journey/parser.y
actionpack-4.0.4 lib/action_dispatch/journey/parser.y
actionpack-4.0.4.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.0.3 lib/action_dispatch/journey/parser.y
actionpack-4.0.2 lib/action_dispatch/journey/parser.y