Remove colons from the normal lexer

This commit is contained in:
Mitchell Hashimoto 2014-08-01 11:25:50 -07:00
parent e9b8055f58
commit 9fee7c831b
3 changed files with 1 additions and 17 deletions

2
lex.go
View File

@ -55,8 +55,6 @@ func (x *hclLex) Lex(yylval *hclSymType) int {
}
switch c {
case ':':
return COLON
case ',':
return COMMA
case '=':

View File

@ -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{

View File

@ -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
%%