mirror of
https://github.com/apple/pkl.git
synced 2026-04-24 09:18:35 +02:00
Fix bug in parsing of super expression (#1364)
This commit is contained in:
15
pkl-core/src/test/files/LanguageSnippetTests/input/parser/spread.pkl
vendored
Normal file
15
pkl-core/src/test/files/LanguageSnippetTests/input/parser/spread.pkl
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
local baz = new Dynamic {}
|
||||||
|
|
||||||
|
local foo = new Dynamic {
|
||||||
|
bar = 1
|
||||||
|
}
|
||||||
|
|
||||||
|
qux {
|
||||||
|
(foo) {
|
||||||
|
...super.bar
|
||||||
|
(baz) {
|
||||||
|
qux = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
8
pkl-core/src/test/files/LanguageSnippetTests/output/parser/spread.pcf
vendored
Normal file
8
pkl-core/src/test/files/LanguageSnippetTests/output/parser/spread.pcf
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
qux {
|
||||||
|
new {
|
||||||
|
bar = 1
|
||||||
|
new {
|
||||||
|
qux = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -973,7 +973,9 @@ public class Parser {
|
|||||||
if (lookahead == Token.DOT) {
|
if (lookahead == Token.DOT) {
|
||||||
next();
|
next();
|
||||||
var identifier = parseIdentifier();
|
var identifier = parseIdentifier();
|
||||||
if (lookahead == Token.LPAREN) {
|
if (lookahead == Token.LPAREN
|
||||||
|
&& !precededBySemicolon
|
||||||
|
&& _lookahead.newLinesBetween == 0) {
|
||||||
var args = parseArgumentList();
|
var args = parseArgumentList();
|
||||||
yield new SuperAccessExpr(identifier, args, start.endWith(args.span()));
|
yield new SuperAccessExpr(identifier, args, start.endWith(args.span()));
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user