Skip to content

Commit

Permalink
Handle comment tokens in parser
Browse files Browse the repository at this point in the history
Signed-off-by: Link Dupont <[email protected]>
  • Loading branch information
subpop committed Nov 27, 2019
1 parent 7db548c commit e1bc02c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ func (p *parser) parse() error {
return err
}
p.tree.global.add(*prop)
case tokenComment:
continue
default:
return &unexpectedTokenErr{got: p.tok}
}
Expand Down
4 changes: 4 additions & 0 deletions parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ func TestParse(t *testing.T) {
},
},
},
{
input: "; this is a comment",
want: newParseTree(),
},
}

for _, test := range tests {
Expand Down

0 comments on commit e1bc02c

Please sign in to comment.