Sha256: 080132f12e6613c8c41fcac1670244c3583674403267fdbd38669ad6a0ee681b

Contents?: true

Size: 1003 Bytes

Versions: 99

Compression:

Stored size: 1003 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, Symbol::GREEDY_EXP)) }
    ;
  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"

Version data entries

99 entries across 94 versions & 7 rubygems

Version Path
actionpack-7.2.2 lib/action_dispatch/journey/parser.y
actionpack-7.1.5 lib/action_dispatch/journey/parser.y
actionpack-7.2.1.2 lib/action_dispatch/journey/parser.y
actionpack-7.1.4.2 lib/action_dispatch/journey/parser.y
actionpack-7.0.8.6 lib/action_dispatch/journey/parser.y
actionpack-6.1.7.10 lib/action_dispatch/journey/parser.y
actionpack-6.1.7.9 lib/action_dispatch/journey/parser.y
actionpack-7.2.1.1 lib/action_dispatch/journey/parser.y
actionpack-7.1.4.1 lib/action_dispatch/journey/parser.y
actionpack-7.0.8.5 lib/action_dispatch/journey/parser.y
actionpack-7.1.4 lib/action_dispatch/journey/parser.y
actionpack-7.2.1 lib/action_dispatch/journey/parser.y
actionpack-7.2.0 lib/action_dispatch/journey/parser.y
actionpack-7.2.0.rc1 lib/action_dispatch/journey/parser.y
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionpack-7.0.8.4/lib/action_dispatch/journey/parser.y
blacklight-spotlight-3.6.0.beta8 vendor/bundle/ruby/3.2.0/gems/actionpack-7.1.3.4/lib/action_dispatch/journey/parser.y
actionpack-7.2.0.beta3 lib/action_dispatch/journey/parser.y
cm-admin-1.5.22 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_dispatch/journey/parser.y
cm-admin-1.5.21 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_dispatch/journey/parser.y
cm-admin-1.5.20 vendor/bundle/ruby/3.3.0/gems/actionpack-7.0.5.1/lib/action_dispatch/journey/parser.y