Merge pull request #5285 from helixbass/browser-compiler-call-parsing-error

Browser compiler call parsing fix
This commit is contained in:
Geoffrey Booth
2019-12-31 09:58:04 -08:00
committed by GitHub
3 changed files with 23 additions and 15 deletions

View File

@@ -1090,19 +1090,19 @@
function() {
return new TaggedTemplateCall($1,
$3,
$2);
$2.soak);
}),
o('Value OptFuncExist Arguments',
function() {
return new Call($1,
$3,
$2);
$2.soak);
}),
o('SUPER OptFuncExist Arguments',
function() {
return new SuperCall(LOC(1)(new Super()),
$3,
$2,
$2.soak,
$1);
}),
o('DYNAMIC_IMPORT Arguments',
@@ -1115,11 +1115,15 @@
OptFuncExist: [
o('',
function() {
return false;
return {
soak: false
};
}),
o('FUNC_EXIST',
function() {
return true;
return {
soak: true
};
})
],
// The list of arguments to a function call.

View File

@@ -664,24 +664,28 @@ break;
case 210:
this.$ = yy.addDataToNode(yy, _$[$0-2], $$[$0-2], _$[$0], $$[$0], true)(new yy.TaggedTemplateCall($$[$0-2],
$$[$0],
$$[$0-1]));
$$[$0-1].soak));
break;
case 211:
this.$ = yy.addDataToNode(yy, _$[$0-2], $$[$0-2], _$[$0], $$[$0], true)(new yy.Call($$[$0-2],
$$[$0],
$$[$0-1]));
$$[$0-1].soak));
break;
case 212:
this.$ = yy.addDataToNode(yy, _$[$0-2], $$[$0-2], _$[$0], $$[$0], true)(new yy.SuperCall(yy.addDataToNode(yy, _$[$0-2], $$[$0-2], null, null, true)(new yy.Super()),
$$[$0],
$$[$0-1],
$$[$0-1].soak,
$$[$0-2]));
break;
case 214:
this.$ = yy.addDataToNode(yy, _$[$0], $$[$0], _$[$0], $$[$0], true)(false);
this.$ = yy.addDataToNode(yy, _$[$0], $$[$0], _$[$0], $$[$0], true)({
soak: false
});
break;
case 215:
this.$ = yy.addDataToNode(yy, _$[$0], $$[$0], _$[$0], $$[$0], true)(true);
this.$ = yy.addDataToNode(yy, _$[$0], $$[$0], _$[$0], $$[$0], true)({
soak: true
});
break;
case 216:
this.$ = yy.addDataToNode(yy, _$[$0-1], $$[$0-1], _$[$0], $$[$0], true)([]);

View File

@@ -524,16 +524,16 @@ grammar =
# Ordinary function invocation, or a chained series of calls.
Invocation: [
o 'Value OptFuncExist String', -> new TaggedTemplateCall $1, $3, $2
o 'Value OptFuncExist Arguments', -> new Call $1, $3, $2
o 'SUPER OptFuncExist Arguments', -> new SuperCall LOC(1)(new Super), $3, $2, $1
o 'Value OptFuncExist String', -> new TaggedTemplateCall $1, $3, $2.soak
o 'Value OptFuncExist Arguments', -> new Call $1, $3, $2.soak
o 'SUPER OptFuncExist Arguments', -> new SuperCall LOC(1)(new Super), $3, $2.soak, $1
o 'DYNAMIC_IMPORT Arguments', -> new DynamicImportCall LOC(1)(new DynamicImport), $2
]
# An optional existence check on a function.
OptFuncExist: [
o '', -> no
o 'FUNC_EXIST', -> yes
o '', -> soak: no
o 'FUNC_EXIST', -> soak: yes
]
# The list of arguments to a function call.