Sha256: 81c2f574feba682ef4a1000b3b1c3bcb0db0566434eb3adec9d1d4cb3ccf7708

Contents?: true

Size: 429 Bytes

Versions: 2

Compression:

Stored size: 429 Bytes

Contents

class Code
  class Parser
    class Code < Parslet::Parser
      rule(:statement) { ::Code::Parser::Statement.new }

      rule(:space) { str(" ") }
      rule(:newline) { str("\n") }
      rule(:whitespace) { (space | newline).repeat(1) }
      rule(:whitespace?) { whitespace.maybe }

      rule(:code) do
        (whitespace? >> statement >> whitespace?).repeat(1) | whitespace?
      end

      root(:code)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
template-ruby-0.2.0 lib/code/parser/code.rb
template-ruby-0.1.0 lib/code/parser/code.rb