lib/shift-lang/parser/token_parser.rb in shift-lang-0.1.1 vs lib/shift-lang/parser/token_parser.rb in shift-lang-0.1.2
- old
+ new
@@ -45,15 +45,15 @@
).repeat >>
double_quotes
end
rule(:string_value) { single_quoted_string | double_quoted_string }
- rule(:identifier) { match('[A-Za-z]') >> match['[A-Za-z0-9_]'].repeat(0) }
+ rule(:identifier) { keyword.absent? >> match('[A-Za-z]') >> match['[A-Za-z0-9_]'].repeat(0) }
rule(:hash_attribute) { string_value | identifier }
- rule(:hash_value) { identifier >> left_square_bracket >> hash_attribute >> right_square_bracket }
+ rule(:hash_value) { keyword.absent? >> identifier >> left_square_bracket >> hash_attribute >> right_square_bracket }
- rule(:object_value) { identifier >> dot >> identifier }
+ rule(:object_value) { keyword.absent? >> identifier >> dot >> keyword.absent? >> identifier }
rule(:variables) { space? >> (object_value.as(:object_value) | hash_value.as(:hash_value) | identifier.as(:identifier)) >> space? }
rule(:string_valued_expression) { read_statement.as(:read_statement) | string_value.as(:string) | variables }
\ No newline at end of file