Skip to content

Commit a4ccd40

Browse files
committed
Update parse.ts
1 parent febc378 commit a4ccd40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

basic-calculator-iv/parse.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { Poly } from "./Poly.ts";
22
/** 我们依然使用递归下降法来解决这个问题,文法如下:
33
4-
exp :=( exp "+"||"-" additive) || additive
4+
expression :=( expression "+"||"-" additive) || additive
55
66
additive := (additive "*" factor) || additive
77
8-
factor := num || "("exp")" || variable(变量)
8+
factor := num || "("expression")" || variable(变量)
99
*/
1010
export function parse(tokens: (string | number)[]): Poly {
1111
let index = 0;

0 commit comments

Comments
 (0)