small renames
This commit is contained in:
parent
ff612446be
commit
72de0089b2
@ -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
|
||||
|
||||
|
@ -20,7 +20,7 @@ module Parser
|
||||
|
||||
class Crystal < Parslet::Parser
|
||||
include BasicTypes
|
||||
include CompundTypes
|
||||
include CompoundTypes
|
||||
include Tokens
|
||||
include Keywords
|
||||
include Control
|
||||
|
@ -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 }
|
||||
|
Loading…
Reference in New Issue
Block a user