From 9a9bc788bab67ff2591ebe412bb6739f2ee4d024 Mon Sep 17 00:00:00 2001 From: peng0723 <10289781@qq.com> Date: Wed, 11 Mar 2020 18:53:57 +0800 Subject: [PATCH] update multiplicative child2 = multiplicative(tokens); --- lab/craft/SimpleCalculator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lab/craft/SimpleCalculator.java b/lab/craft/SimpleCalculator.java index e25e71f..e01abfc 100644 --- a/lab/craft/SimpleCalculator.java +++ b/lab/craft/SimpleCalculator.java @@ -221,7 +221,7 @@ private SimpleASTNode multiplicative(TokenReader tokens) throws Exception { if (child1 != null && token != null) { if (token.getType() == TokenType.Star || token.getType() == TokenType.Slash) { token = tokens.read(); - SimpleASTNode child2 = primary(tokens); + SimpleASTNode child2 = multiplicative(tokens); if (child2 != null) { node = new SimpleASTNode(ASTNodeType.Multiplicative, token.getText()); node.addChild(child1);