comments
This commit is contained in:
@@ -153,6 +153,8 @@ func (p *Parser) parseStatement() ast.Statement {
|
||||
}
|
||||
|
||||
switch p.curToken.Type {
|
||||
case token.COMMENT:
|
||||
return p.parseComment()
|
||||
case token.LET:
|
||||
return p.parseLetStatement()
|
||||
case token.RETURN:
|
||||
@@ -542,3 +544,7 @@ func (p *Parser) parseAssignmentStatement() ast.Statement {
|
||||
|
||||
return stmt
|
||||
}
|
||||
|
||||
func (p *Parser) parseComment() ast.Statement {
|
||||
return &ast.Comment{Token: p.curToken, Value: p.curToken.Literal}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user