@yannosay/sinth 0.2.0 → 0.2.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.
- package/package.json +1 -1
- package/src/sinth.ts +3 -1
package/package.json
CHANGED
package/src/sinth.ts
CHANGED
|
@@ -802,7 +802,9 @@ export class Parser {
|
|
|
802
802
|
this.consume(TT.LPAREN);
|
|
803
803
|
while (!this.check(TT.RPAREN)) {
|
|
804
804
|
const ploc = this.peek().loc;
|
|
805
|
-
|
|
805
|
+
// allow keywords as parameter names (e.g., "for" in custom-element declarations)
|
|
806
|
+
const nameTok = this.check(TT.IDENT) ? this.consume(TT.IDENT) : this.consume(this.peek().type);
|
|
807
|
+
const pname = nameTok.value;
|
|
806
808
|
let defaultVal: Literal | undefined;
|
|
807
809
|
if (this.check(TT.EQUALS)) { this.consume(TT.EQUALS); defaultVal = this.parseLiteral(); }
|
|
808
810
|
params.push({ name: pname, defaultVal, loc: ploc });
|