module Pione::Lang::DeclarationParser

DeclarationParser is a set of parsers for PIONE declaration setences and blocks.

Constants

BLOCKS

BLOCKS is a list of declaration blocks in PIONE language.

SENTENCES

SENTENCES is a list of declarative sentences in PIONE language.

Public Instance Methods

binding_sentence(declarator, operator, omittable) click to toggle source

Make a parser for binding sentences.

# File lib/pione/lang/declaration-parser.rb, line 53
def binding_sentence(declarator, operator, omittable)
  binding = expr.as(:expr1) >> padded?(operator) >> expr!.as(:expr2)

  if omittable
    line((declarator.as(:declarator) >> pad).maybe >> binding)
  else
    line(declarator.as(:declarator) >> pad >> binding)
  end
end