ether-code 0.7.4 → 0.7.5
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/cli/ether.js +1 -1
- package/ether-parser.js +17 -0
- package/package.json +1 -1
package/cli/ether.js
CHANGED
package/ether-parser.js
CHANGED
|
@@ -2232,11 +2232,14 @@ class EtherParser {
|
|
|
2232
2232
|
const params = []
|
|
2233
2233
|
if (this.match(TokenType.LPAREN)) {
|
|
2234
2234
|
while (!this.isAtEnd() && !this.match(TokenType.RPAREN)) {
|
|
2235
|
+
while (this.match(TokenType.NEWLINE) || this.match(TokenType.INDENT) || this.match(TokenType.DEDENT)) {}
|
|
2236
|
+
if (this.check(TokenType.RPAREN)) break
|
|
2235
2237
|
const param = this.parseParameter(lang)
|
|
2236
2238
|
if (param) {
|
|
2237
2239
|
params.push(param)
|
|
2238
2240
|
}
|
|
2239
2241
|
this.match(TokenType.COMMA)
|
|
2242
|
+
while (this.match(TokenType.NEWLINE) || this.match(TokenType.INDENT) || this.match(TokenType.DEDENT)) {}
|
|
2240
2243
|
}
|
|
2241
2244
|
} else {
|
|
2242
2245
|
while (!this.isAtEnd()) {
|
|
@@ -2289,11 +2292,14 @@ class EtherParser {
|
|
|
2289
2292
|
const params = []
|
|
2290
2293
|
if (this.match(TokenType.LPAREN)) {
|
|
2291
2294
|
while (!this.isAtEnd() && !this.match(TokenType.RPAREN)) {
|
|
2295
|
+
while (this.match(TokenType.NEWLINE) || this.match(TokenType.INDENT) || this.match(TokenType.DEDENT)) {}
|
|
2296
|
+
if (this.check(TokenType.RPAREN)) break
|
|
2292
2297
|
const param = this.parseParameter(lang)
|
|
2293
2298
|
if (param) {
|
|
2294
2299
|
params.push(param)
|
|
2295
2300
|
}
|
|
2296
2301
|
this.match(TokenType.COMMA)
|
|
2302
|
+
while (this.match(TokenType.NEWLINE) || this.match(TokenType.INDENT) || this.match(TokenType.DEDENT)) {}
|
|
2297
2303
|
}
|
|
2298
2304
|
}
|
|
2299
2305
|
|
|
@@ -2718,6 +2724,14 @@ class EtherParser {
|
|
|
2718
2724
|
break
|
|
2719
2725
|
}
|
|
2720
2726
|
|
|
2727
|
+
if (current && current.type === TokenType.COMMA) {
|
|
2728
|
+
break
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
if (current && current.type === TokenType.RPAREN) {
|
|
2732
|
+
break
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2721
2735
|
if (current && (current.type === TokenType.INDENT || current.type === TokenType.NEWLINE)) {
|
|
2722
2736
|
this.advance()
|
|
2723
2737
|
continue
|
|
@@ -2908,8 +2922,11 @@ class EtherParser {
|
|
|
2908
2922
|
if (this.match(TokenType.LPAREN)) {
|
|
2909
2923
|
const args = []
|
|
2910
2924
|
while (!this.isAtEnd() && !this.match(TokenType.RPAREN)) {
|
|
2925
|
+
while (this.match(TokenType.NEWLINE) || this.match(TokenType.INDENT) || this.match(TokenType.DEDENT)) {}
|
|
2926
|
+
if (this.check(TokenType.RPAREN)) break
|
|
2911
2927
|
args.push(this.parseExpression(lang))
|
|
2912
2928
|
this.match(TokenType.COMMA)
|
|
2929
|
+
while (this.match(TokenType.NEWLINE) || this.match(TokenType.INDENT) || this.match(TokenType.DEDENT)) {}
|
|
2913
2930
|
}
|
|
2914
2931
|
expr = { type: 'CallExpression', callee: expr, arguments: args }
|
|
2915
2932
|
} else if (this.match(TokenType.DOT)) {
|