Sha256: d3673ebf2b8139b6679205f9b74d5892ee00b5e7348fa5262420ec402a1cebb1

Contents?: true

Size: 577 Bytes

Versions: 4

Compression:

Stored size: 577 Bytes

Contents

require 'parslet'

module Shift
	module Parser
		include Parslet

		rule(:if_statement) { if_keyword >> space >> (conditional_statement | boolean_valued_expression).as(:condition)}

		rule(:for_statement) { for_keyword >> space >> primitives >> in_keyword >> primitives }

		rule(:while_statement) { while_keyword >> space >> (conditional_statement | boolean_valued_expression).as(:condition) }


		rule(:control_statement) { if_statement.as(:if_statement) | else_keyword.as(:else_statement) | for_statement.as(:for_statement) | while_statement.as(:while_statement) }

	end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
shift-lang-0.1.4 lib/shift-lang/parser/control_statement_parser.rb
shift-lang-0.1.3 lib/shift-lang/parser/control_statement_parser.rb
shift-lang-0.1.2 lib/shift-lang/parser/control_statement_parser.rb
shift-lang-0.1.1 lib/shift-lang/parser/control_statement_parser.rb