File tree 1 file changed +9
-4
lines changed
compiler/src/dotty/tools/dotc/parsing
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -315,9 +315,11 @@ object MarkupParsers {
315
315
}
316
316
317
317
/** Some try/catch/finally logic used by xLiteral and xLiteralPattern. */
318
- private def xLiteralCommon (f : () => Tree , ifTruncated : String => Unit ): Tree = {
319
- try return f()
320
- catch {
318
+ @ inline private def xLiteralCommon (f : () => Tree , ifTruncated : String => Unit ): Tree = {
319
+ var result : Tree = null
320
+ try {
321
+ result = f()
322
+ } catch {
321
323
case c @ TruncatedXMLControl =>
322
324
ifTruncated(c.getMessage)
323
325
case c @ (MissingEndTagControl | ConfusedAboutBracesControl ) =>
@@ -327,7 +329,10 @@ object MarkupParsers {
327
329
}
328
330
finally parser.in resume Tokens .XMLSTART
329
331
330
- parser.errorTermTree
332
+ if (result == null )
333
+ parser.errorTermTree
334
+ else
335
+ result
331
336
}
332
337
333
338
/** Use a lookahead parser to run speculative body, and return the first char afterward. */
You can’t perform that action at this time.
0 commit comments