Sha256: 9c0196ef30fcdb33a63bb29b0f19158a349c647cbb9efee6f888e4f1893248a3

Contents?: true

Size: 397 Bytes

Versions: 6

Compression:

Stored size: 397 Bytes

Contents

class Code
  class Parser
    class Group < Parslet::Parser
      rule(:name) { ::Code::Parser::Name.new }
      rule(:code) { ::Code::Parser::Code.new }

      rule(:opening_parenthesis) { str("(") }
      rule(:closing_parenthesis) { str(")") }

      rule(:group) do
        (opening_parenthesis >> code >> closing_parenthesis).as(:group) | name
      end

      root(:group)
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
code-ruby-0.2.4 lib/code/parser/group.rb
template-ruby-0.2.4 lib/code/parser/group.rb
template-ruby-0.2.3 lib/code/parser/group.rb
template-ruby-0.2.2 lib/code/parser/group.rb
template-ruby-0.2.1 lib/code/parser/group.rb
template-ruby-0.2.0 lib/code/parser/group.rb