@yannosay/sinth 0.18.0 → 0.18.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/core/parser.ts +11 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yannosay/sinth",
3
- "version": "0.18.0",
3
+ "version": "0.18.1",
4
4
  "description": "A declarative & reactive language that compiles to pure HTML, CSS, and JavaScript.",
5
5
  "author": "Yannosay Productions",
6
6
  "license": "AGPL-3.0",
@@ -106,7 +106,17 @@ sinthRender();`;
106
106
 
107
107
  if (nextType === TT.LPAREN && identName[0] === identName[0].toLowerCase()) {
108
108
  this.consume(TT.IDENT);
109
- const expr = this.parseCallExpr({ kind: "variable", name: identName });
109
+ this.consume(TT.LPAREN);
110
+ const args: Expression[] = [];
111
+ if (!this.check(TT.RPAREN)) {
112
+ args.push(this.parseExpression()!);
113
+ while (this.check(TT.COMMA)) {
114
+ this.consume(TT.COMMA);
115
+ args.push(this.parseExpression()!);
116
+ }
117
+ }
118
+ this.consume(TT.RPAREN);
119
+ const expr: Expression = { kind: "call", callee: { kind: "variable", name: identName }, args };
110
120
  uses.push({ kind: "use", name: "__IF_ROOT__", attrs: [], children: [{ kind: "expr", expression: expr, loc: this.peek().loc }], loc: this.peek().loc });
111
121
  } else {
112
122
  this.pos = savedPos;