Skip to content

Instantly share code, notes, and snippets.

@0xkohe
Created September 26, 2019 04:51
Show Gist options
  • Save 0xkohe/57fcf2b867adb0a940f8918dff385470 to your computer and use it in GitHub Desktop.
Save 0xkohe/57fcf2b867adb0a940f8918dff385470 to your computer and use it in GitHub Desktop.
[Blog][TopDownOperatorPrecedence(再帰下降構文解析)におけるExpression(式)の解析処理を追う] parseExpressionStatement.go
func (p *Parser) parseExpressionStatement() *ast.ExpressionStatement {
stmt := &ast.ExpressionStatement{Token: p.curToken}
stmt.Expression = p.parseExpression(LOWEST)
if p.peekTokenIs(token.SEMICOLON) {
p.nextToken()
}
return stmt
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment