0
+ include Treetop::Runtime
0
+ @root || :uri_template
0
+ #raise more_elements.elements.inspect
0
+ uri_element.value(env) << more_elements.elements.map{|el| el.value(env)}.join
0
+ if node_cache[:uri_template].has_key?(index)
0
+ cached = node_cache[:uri_template][index]
0
+ @index = cached.interval.end if cached
0
+ r2 = SyntaxNode.new(input, i2...index, s2)
0
+ r0 = (SyntaxNode).new(input, i0...index, s0)
0
+ r0.extend(UriTemplate0)
0
+ r0.extend(UriTemplate1)
0
+ node_cache[:uri_template][start_index] = r0
0
+ if node_cache[:uri_element].has_key?(index)
0
+ cached = node_cache[:uri_element][index]
0
+ @index = cached.interval.end if cached
0
+ node_cache[:uri_element][start_index] = r0
0
+ if c.respond_to? :value
0
+ c.interval.to_s + "<>"
0
+ if node_cache[:expansion].has_key?(index)
0
+ cached = node_cache[:expansion][index]
0
+ @index = cached.interval.end if cached
0
+ if input.index('{', index) == index
0
+ r1 = (SyntaxNode).new(input, index...(index + 1))
0
+ terminal_parse_failure('{')
0
+ if input.index('}', index) == index
0
+ r5 = (SyntaxNode).new(input, index...(index + 1))
0
+ terminal_parse_failure('}')
0
+ r0 = (SyntaxNode).new(input, i0...index, s0)
0
+ node_cache[:expansion][start_index] = r0
0
+ if node_cache[:uri_part].has_key?(index)
0
+ cached = node_cache[:uri_part][index]
0
+ @index = cached.interval.end if cached
0
+ node_cache[:uri_part][start_index] = r0
0
+ if node_cache[:arg].has_key?(index)
0
+ cached = node_cache[:arg][index]
0
+ @index = cached.interval.end if cached
0
+ r0 = SyntaxNode.new(input, i0...index, s0)
0
+ node_cache[:arg][start_index] = r0
0
+ # If one or more of the variables are defined and non-empty then
0
+ # substitute the value of 'arg', otherwise substitute the empty string.
0
+ lambda do |env, arg, vars|
0
+ vars.split(',').each do |var|
0
+ if !env[var].to_s.blank?
0
+ # If all of the variables are un-defined or empty then substitute the
0
+ # value of arg, otherwise substitute the empty string.
0
+ lambda do |env, arg, vars|
0
+ vars.split(',').each do |var|
0
+ if !env[var].to_s.blank?
0
+ # The prefix operator MUST only have one variable in its expansion. If
0
+ # the variable is defined and non-empty then substitute the value of
0
+ # arg followed by the value of the variable, otherwise substitute the
0
+ lambda do |env, prefix, vars|
0
+ if vars =~ /([^=]+)=([^=]+)/
0
+ var, default = $1.dup, $2.dup
0
+ v = default if v.to_s.blank?
0
+ !v.blank? ? "#{prefix}#{UriTemplate::Encoder.encode(v)}" : ""
0
+ # The append operator MUST only have one variable in its expansion. If
0
+ # the variable is defined and non-empty then substitute the value of
0
+ # the variable followed by the value of arg, otherwise substitute the
0
+ lambda do |env, append, vars|
0
+ if vars =~ /([^=]+)=([^=]+)/
0
+ var, default = $1.dup, $2.dup