Fix some parsing issues in MatchExpression
This commit is contained in:
parent
fd462f6d05
commit
eaead44b18
1 changed files with 1 additions and 18 deletions
|
@ -433,35 +433,17 @@ after_tuple_element:
|
||||||
}
|
}
|
||||||
auto Pattern = parsePattern();
|
auto Pattern = parsePattern();
|
||||||
if (!Pattern) {
|
if (!Pattern) {
|
||||||
T0->unref();
|
|
||||||
Value->unref();
|
|
||||||
BlockStart->unref();
|
|
||||||
for (auto Case: Cases) {
|
|
||||||
Case->unref();
|
|
||||||
}
|
|
||||||
skipToLineFoldEnd();
|
skipToLineFoldEnd();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto RArrowAlt = expectToken<class RArrowAlt>();
|
auto RArrowAlt = expectToken<class RArrowAlt>();
|
||||||
if (!RArrowAlt) {
|
if (!RArrowAlt) {
|
||||||
T0->unref();
|
|
||||||
Value->unref();
|
|
||||||
BlockStart->unref();
|
|
||||||
for (auto Case: Cases) {
|
|
||||||
Case->unref();
|
|
||||||
}
|
|
||||||
Pattern->unref();
|
Pattern->unref();
|
||||||
skipToLineFoldEnd();
|
skipToLineFoldEnd();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto Expression = parseExpression();
|
auto Expression = parseExpression();
|
||||||
if (!Expression) {
|
if (!Expression) {
|
||||||
T0->unref();
|
|
||||||
Value->unref();
|
|
||||||
BlockStart->unref();
|
|
||||||
for (auto Case: Cases) {
|
|
||||||
Case->unref();
|
|
||||||
}
|
|
||||||
Pattern->unref();
|
Pattern->unref();
|
||||||
RArrowAlt->unref();
|
RArrowAlt->unref();
|
||||||
skipToLineFoldEnd();
|
skipToLineFoldEnd();
|
||||||
|
@ -1013,6 +995,7 @@ finish:
|
||||||
default:
|
default:
|
||||||
auto P = parsePattern();
|
auto P = parsePattern();
|
||||||
if (!P) {
|
if (!P) {
|
||||||
|
Tokens.get();
|
||||||
P = new BindPattern(new Identifier("_"));
|
P = new BindPattern(new Identifier("_"));
|
||||||
}
|
}
|
||||||
Params.push_back(new Parameter(P, nullptr));
|
Params.push_back(new Parameter(P, nullptr));
|
||||||
|
|
Loading…
Reference in a new issue