summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-01-21 17:48:28 +0530
committerAkshay Nair <phenax5@gmail.com>2024-01-21 17:48:28 +0530
commitc9075367a178644d12a179919aa07616938b7315 (patch)
treed3ffccc2b1db372e496016caa145f00ca7b81409 /src
parentc7a137861494edd65d0c8de76ab09f422ab15481 (diff)
downloadcss-everything-c9075367a178644d12a179919aa07616938b7315.tar.gz
css-everything-c9075367a178644d12a179919aa07616938b7315.zip
fix: fixes nested fixity issue
Diffstat (limited to 'src')
-rw-r--r--src/parser.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/parser.ts b/src/parser.ts
index c2aa30f..81f7a9e 100644
--- a/src/parser.ts
+++ b/src/parser.ts
@@ -119,14 +119,10 @@ const precedence = (op: BinOp) =>
const binOpWithFixitySwitchity = (op: BinOp, left: Expr, right: Expr) =>
match(right, {
BinOp: binOp => {
- if (precedence(op) > precedence(binOp.op)) {
+ if (precedence(op) >= precedence(binOp.op)) {
return Expr.BinOp({
op: binOp.op,
- left: Expr.BinOp({
- op,
- left: left,
- right: binOp.left,
- }),
+ left: binOpWithFixitySwitchity(op, left, binOp.left),
right: binOp.right,
})
}