Skip to content

Commit 7dc7597

Browse files
committed
Update comment
1 parent 4865477 commit 7dc7597

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/parser.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,10 @@ function findBinaryFunction(tokens: ExprElement[], fn: string) {
163163
}
164164
}
165165

166-
// Some minuses have been parsed as functions (i.e. an `ExprFunction` with a single argument).
167-
// If they are preceded by something, we need to treat the expression as a unary minus.
166+
// Some minuses are initially parsed as unary functions (i.e. the string "- b" is parsed an `ExprFunction` with
167+
// `.fn` = "−" and an `ExprIdentifier` "b" as its single argument.)
168+
// If any unary minus function is preceded by another token, we need to merge the pair of tokens into a binary minus
169+
// function.
168170
function findBinaryMinusFunctions(tokens: ExprElement[]) {
169171
for (let i = 1; i < tokens.length; i++) {
170172
const token = tokens[i];

0 commit comments

Comments
 (0)