Sha256: 4cd3680a1a54346478c4282ed88e05cecd06ec85f8269f803298839062613f63

Contents?: true

Size: 1 KB

Versions: 17

Compression:

Stored size: 1 KB

Contents

#
#
# Rules for verious lists.
# This file is just an example, you cannot compile this file.

class ExampleOnly
rule

# a list, which minimum number of items is 0
list0 :
          {
            result = []
          }
      | list0 item
          {
            result.push val[1]
          }

# a list, which minimum number of items is 1
list1 : item
          {
            result = val
          }
      | list1 item
          {
            result.push val[1]
          }

# a list, separated by comma
clist : item
          {
            result = val
          }
      | clist ',' item
          {
            result.push val[2]
          }

# a hash. see also "hash.y".
hash  : '{' hash_contents '}'
          {
            result = val[1]
          }
      | '{' '}'
          {
            result = {}
          }

hash_contents
      : item "=>" item
          {
            result = { val[0] => val[2] }
          }
      | hash_contents ',' item "=>" item
          {
            result[val[2]] = val[4]
          }

Version data entries

17 entries across 12 versions & 4 rubygems

Version Path
tdiary-5.2.0 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.7 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.7 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/sample/lists.y
rails_mini_profiler-0.2.0 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/sample/lists.y
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.6 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.5 vendor/bundle/ruby/2.7.0/gems/racc-1.5.2/sample/lists.y
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/racc-1.5.2/sample/lists.y
racc-1.5.2-java sample/lists.y
racc-1.5.2 sample/lists.y
racc-1.5.1-java sample/lists.y
racc-1.5.1 sample/lists.y
racc-1.5.0-java sample/lists.y
racc-1.5.0 sample/lists.y