Skip to content

Commit

Permalink
Don't add comments to AST
Browse files Browse the repository at this point in the history
Closes #388.
  • Loading branch information
gromgit committed Aug 5, 2020
1 parent 5e90b88 commit d36e9aa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ func (p *Parser) ParseProgram() *ast.Program {
}

func (p *Parser) parseStatement() ast.Statement {
if p.curToken.Type == token.COMMENT {
return nil
}

if p.curToken.Type == token.RETURN {
return p.parseReturnStatement()
}
Expand Down

0 comments on commit d36e9aa

Please sign in to comment.