From cbbeff99083daa3f92c6a1fd405a9f0afc5e215a Mon Sep 17 00:00:00 2001 From: Jordan Orelli Date: Wed, 25 Mar 2015 09:26:54 -0400 Subject: [PATCH] strip comments from the parse tree I dunno if I'll like this decision in the long run, but we'll try it. --- parse.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parse.go b/parse.go index 766deaf..29183fa 100644 --- a/parse.go +++ b/parse.go @@ -40,10 +40,14 @@ func (p *parser) next() token { p.backup = p.backup[:len(p.backup)-1] return t } +SKIP_COMMENTS: t, ok := <-p.input if !ok { return token{t_eof, "eof"} } + if t.t == t_comment { + goto SKIP_COMMENTS + } return t }