Skip to content

Instantly share code, notes, and snippets.

@kooooohe
Created September 26, 2019 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kooooohe/57fcf2b867adb0a940f8918dff385470 to your computer and use it in GitHub Desktop.
Save kooooohe/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