Sha256: da79bc8d0e6f678ad18c0292575807fea363d906a448205e3047112289605a86

Contents?: true

Size: 967 Bytes

Versions: 44

Compression:

Stored size: 967 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

44 entries across 44 versions & 3 rubygems

Version Path
actionpack-4.1.16 lib/action_dispatch/journey/parser.y
actionpack-4.1.16.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.1.15 lib/action_dispatch/journey/parser.y
actionpack-4.1.15.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.1.14.2 lib/action_dispatch/journey/parser.y
actionpack-4.1.14.1 lib/action_dispatch/journey/parser.y
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/actionpack-4.1.13/lib/action_dispatch/journey/parser.y
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/actionpack-4.1.13/lib/action_dispatch/journey/parser.y
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/actionpack-4.1.13/lib/action_dispatch/journey/parser.y
actionpack-4.1.14 lib/action_dispatch/journey/parser.y
actionpack-4.1.14.rc2 lib/action_dispatch/journey/parser.y
actionpack-4.1.14.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.1.13 lib/action_dispatch/journey/parser.y
actionpack-4.1.13.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.1.12 lib/action_dispatch/journey/parser.y
actionpack-4.1.12.rc1 lib/action_dispatch/journey/parser.y
actionpack-4.1.11 lib/action_dispatch/journey/parser.y
actionpack-4.1.10 lib/action_dispatch/journey/parser.y
actionpack-4.1.10.rc4 lib/action_dispatch/journey/parser.y
actionpack-4.1.10.rc3 lib/action_dispatch/journey/parser.y