Uploaded image for project: 'Appcelerator Studio'
  1. Appcelerator Studio
  2. TISTUD-2539

JS Parser Validation: Failed to parse file Cannot recover from the syntax error

    Details

    • Story Points:
      3

      Description

      Saw this in the log. I created two projects, inserted two breakpoints, and ran both in android device. They were default projects, one with an extra event listener.

      Log:

      !ENTRY com.aptana.editor.js 4 0 2012-10-16 15:29:36.290
      !MESSAGE (Build 3.0.0.201210151149) [ERROR]  Failed to parse file:/Users/dhyde/Desktop/TISTUD-RC/workspace/MyProject/Resources/app.js for JS Parser Validation
      !STACK 1
      org.eclipse.core.runtime.CoreException: Cannot recover from the syntax error
      	at com.aptana.index.core.build.BuildContext.getAST(BuildContext.java:129)
      	at com.aptana.index.core.build.BuildContext.getAST(BuildContext.java:97)
      	at com.aptana.editor.js.validator.JSParserValidator.buildFile(JSParserValidator.java:145)
      	at com.aptana.core.internal.build.LazyBuildParticipant.buildFile(LazyBuildParticipant.java:72)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.runParticipants(CommonReconcilingStrategy.java:333)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.reconcile(CommonReconcilingStrategy.java:273)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.reconcile(CommonReconcilingStrategy.java:231)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.fullReconcile(CommonReconcilingStrategy.java:437)
      	at com.aptana.editor.common.text.reconciler.CommonReconciler.process(CommonReconciler.java:162)
      	at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
      Caused by: beaver.Parser$Exception: Cannot recover from the syntax error
      	at beaver.Parser.recoverFromError(Parser.java:697)
      	at com.aptana.editor.js.parsing.JSParser.recoverFromError(JSParser.java:557)
      	at beaver.Parser.parse(Parser.java:498)
      	at beaver.Parser.parse(Parser.java:439)
      	at com.aptana.editor.js.parsing.JSParser.parse(JSParser.java:383)
      	at com.aptana.editor.js.parsing.JSParser.parse(JSParser.java:345)
      	at com.aptana.parsing.ParsingEngine.noCacheParse(ParsingEngine.java:424)
      	at com.aptana.parsing.ParsingEngine.parse(ParsingEngine.java:229)
      	at com.aptana.parsing.ParserPoolFactory.parse(ParserPoolFactory.java:230)
      	at com.aptana.index.core.build.BuildContext.parse(BuildContext.java:150)
      	at com.aptana.index.core.build.BuildContext.getAST(BuildContext.java:121)
      	... 9 more
      !SUBENTRY 1 com.aptana.index.core 4 0 2012-10-16 15:29:36.290
      !MESSAGE Cannot recover from the syntax error
      !STACK 0
      beaver.Parser$Exception: Cannot recover from the syntax error
      	at beaver.Parser.recoverFromError(Parser.java:697)
      	at com.aptana.editor.js.parsing.JSParser.recoverFromError(JSParser.java:557)
      	at beaver.Parser.parse(Parser.java:498)
      	at beaver.Parser.parse(Parser.java:439)
      	at com.aptana.editor.js.parsing.JSParser.parse(JSParser.java:383)
      	at com.aptana.editor.js.parsing.JSParser.parse(JSParser.java:345)
      	at com.aptana.parsing.ParsingEngine.noCacheParse(ParsingEngine.java:424)
      	at com.aptana.parsing.ParsingEngine.parse(ParsingEngine.java:229)
      	at com.aptana.parsing.ParserPoolFactory.parse(ParserPoolFactory.java:230)
      	at com.aptana.index.core.build.BuildContext.parse(BuildContext.java:150)
      	at com.aptana.index.core.build.BuildContext.getAST(BuildContext.java:121)
      	at com.aptana.index.core.build.BuildContext.getAST(BuildContext.java:97)
      	at com.aptana.editor.js.validator.JSParserValidator.buildFile(JSParserValidator.java:145)
      	at com.aptana.core.internal.build.LazyBuildParticipant.buildFile(LazyBuildParticipant.java:72)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.runParticipants(CommonReconcilingStrategy.java:333)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.reconcile(CommonReconcilingStrategy.java:273)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.reconcile(CommonReconcilingStrategy.java:231)
      	at com.aptana.editor.common.text.reconciler.CommonReconcilingStrategy.fullReconcile(CommonReconcilingStrategy.java:437)
      	at com.aptana.editor.common.text.reconciler.CommonReconciler.process(CommonReconciler.java:162)
      	at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:206)
      

      app.js

      // this sets the background color of the master UIView (when there are no windows/tab groups on it)
      Titanium.UI.setBackgroundColor('#000');
       
      // create tab group
      var tabGroup = Titanium.UI.createTabGroup();
       
       
      //
      // create base UI tab and root window
      //
      var win1 = Titanium.UI.createWindow({  
          title:'Tab 1',
          backgroundColor:'red'
      });
      var tab1 = Titanium.UI.createTab({  
          icon:'KS_nav_views.png',
          title:'Tab 1',
          window:win1
      });
       
      var label1 = Titanium.UI.createLabel({
      	color:'#999',
      	text:'I am Window 1',
      	font:{fontSize:20,fontFamily:'Helvetica Neue'},
      	textAlign:'center',
      	width:'auto'
      });
       
      win1.add(label1);
       
      //
      // create controls tab and root window
      //
      var win2 = Titanium.UI.createWindow({  
          title:'Tab 2',
          backgroundColor:'#fff'
      });
      var tab2 = Titanium.UI.createTab({  
          icon:'KS_nav_ui.png',
          title:'Tab 2',
          window:win2
      });
       
      var label2 = Titanium.UI.createLabel({
      	color:'#999',
      	text:'I am Window 2',
      	font:{fontSize:20,fontFamily:'Helvetica Neue'},
      	textAlign:'center',
      	width:'auto'
      });
       
      win2.add(label2);
       
       
       
      //
      //  add tabs
      //
      tabGroup.addTab(tab1);  
      tabGroup.addTab(tab2);  
       
       
      // open tab group
      tabGroup.open();
       
      win1.addEventListener('click', function(){
      	win1.backgroundColor = win1.backgroundColor == 'red' ? 'blue' : 'red';
      });
      

        Attachments

          Activity

            People

            • Assignee:
              mxia Michael Xia
              Reporter:
              dhyde Dustin Hyde
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: