small renames

This commit is contained in:
Torsten Ruger 2014-05-13 08:24:55 +03:00
parent ff612446be
commit 72de0089b2
3 changed files with 5 additions and 5 deletions

View File

@ -1,12 +1,12 @@
module Parser
# Compound types are Arrays and Hashes
module CompundTypes
module CompoundTypes
include Parslet
rule(:array) do
left_bracket >>
( ((operator_expression|value_expression).as(:element) >> space? >>
(comma >> space? >> (operator_expression|value_expression).as(:element)).repeat(0)).repeat(0,1)).as(:array) >>
( ((operator_expression|value_expression).as(:array_element) >> space? >>
(comma >> space? >> (operator_expression|value_expression).as(:array_element)).repeat(0)).repeat(0,1)).as(:array) >>
space? >> right_bracket
end

View File

@ -20,7 +20,7 @@ module Parser
class Crystal < Parslet::Parser
include BasicTypes
include CompundTypes
include CompoundTypes
include Tokens
include Keywords
include Control

View File

@ -11,7 +11,7 @@ module Parser
rule(:name => simple(:name)) { Ast::NameExpression.new(name.to_s) }
rule(:array => sequence(:array) ) { Ast::ArrayExpression.new(array) }
rule(:element => simple(:element)) { element }
rule(:array_element => simple(:array_element)) { array_element }
rule(:hash => sequence(:hash) ) { Ast::HashExpression.new(hash) }
rule(:hash_key => simple(:hash_key) , :hash_value => simple(:hash_value)) { Ast::AssociationExpression.new(hash_key,hash_value) }
rule(:hash_pair => simple(:hash_pair) ) { hash_pair }