Skip to content

Commit

Permalink
Remove colons from the normal lexer
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchellh committed Aug 1, 2014
1 parent e9b8055 commit 9fee7c8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
2 changes: 0 additions & 2 deletions lex.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ func (x *hclLex) Lex(yylval *hclSymType) int {
}

switch c {
case ':':
return COLON
case ',':
return COMMA
case '=':
Expand Down
14 changes: 0 additions & 14 deletions lex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,6 @@ func TestLex(t *testing.T) {
lexEOF,
},
},
{
"assign_colon.hcl",
[]int{
IDENTIFIER, EQUAL, LEFTBRACKET, LEFTBRACE,
STRING, COLON, LEFTBRACE,
STRING, COLON, LEFTBRACE, RIGHTBRACE, COMMA,
STRING, COLON, LEFTBRACKET,
NUMBER, COMMA, NUMBER, COMMA, STRING,
RIGHTBRACKET, COMMA,
RIGHTBRACE,
RIGHTBRACE, RIGHTBRACKET,
lexEOF,
},
},
{
"list.hcl",
[]int{
Expand Down
2 changes: 1 addition & 1 deletion parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package hcl
%type <str> blockId

%token <num> NUMBER
%token <str> COLON COMMA IDENTIFIER EQUAL NEWLINE STRING
%token <str> COMMA IDENTIFIER EQUAL NEWLINE STRING
%token <str> LEFTBRACE RIGHTBRACE LEFTBRACKET RIGHTBRACKET

%%
Expand Down

0 comments on commit 9fee7c8

Please sign in to comment.