private StatementNode parseLabeledOrLocalDeclarationOrExpressionStatement() {
     var restorePoint = this.createRestorePoint();
     saveScannerState();
     if (isIdentifier(lexicalUnit)) {
         int sp = scanner.StartPosition;
         int len = getLexicalUnitLength();
         if (nextLexicalUnit(true) == LexicalUnit.Colon) {
             nextLexicalUnit(true);
             var labeled = new LabeledStatementNode { NameOffset = sp, NameLength = len };
             setSavedScannerState(labeled);
             labeled.Statement = parseStatement();
             labeled.EndPosition = labeled.Statement.EndPosition;
             return labeled;
         }
         this.restore(restorePoint);
     }
     var type = parseType(false);
     if (type != null && isIdentifier(lexicalUnit)) {
         return parseLocalDeclarationStatement(type, true);
     } else {
         this.restore(restorePoint);
         return parseExpressionStatement(true);
     }
 }
Esempio n. 2
0
 protected virtual TResult handleLabeled(LabeledStatementNode labeled, TSource source)
 {
     return(defaultHandler());
 }