qorf / quorum-language

The primary repository for the Quorum Programming Language
BSD 3-Clause "New" or "Revised" License
20 stars 10 forks source link

Crash trying to parse specific code #104

Closed GabeContra closed 11 months ago

GabeContra commented 1 year ago
action MyAction returns

This code causes a crash when trying to parse and will crash quorum studio if you try to open a file containing it StackTrace:

Error: The object being referenced is undefined.
   file: ActionsNoClassContext.quorum,  class: Libraries.Language.Compile.Context.ActionsNoClassContext,  action: Traverse,  line: 25 
   file: NoClassDeclarationContext.quorum,  class: Libraries.Language.Compile.Context.NoClassDeclarationContext,  action: Traverse,  line: 10 
   file: StartContext.quorum,  class: Libraries.Language.Compile.Context.StartContext,  action: Traverse,  line: 30 
   file: ParserToBlockListener.quorum,  class: Libraries.Language.Compile.Blocks.ParserToBlockListener,  action: Update,  line: 613 
   file: CodeEditor.quorum,  class: Libraries.Interface.Controls.Blocks.CodeEditor,  action: RegenerateBlocks,  line: 892 
   file: CodeEditor.quorum,  class: Libraries.Interface.Controls.Blocks.CodeEditor,  action: RefreshScrollableRegion,  line: 874 
   file: ScrollableControl.quorum,  class: Libraries.Interface.Controls.ScrollableControl,  action: RefreshPaneView,  line: 364 
   file: CodeEditor.quorum,  class: Libraries.Interface.Controls.Blocks.CodeEditor,  action: RefreshPaneView,  line: -1 
   file: ScrollableControl.quorum,  class: Libraries.Interface.Controls.ScrollableControl,  action: Resize,  line: 294 
   file: CodeEditor.quorum,  class: Libraries.Interface.Controls.Blocks.CodeEditor,  action: Resize,  line: -1 
   file: Item2D.quorum,  class: Libraries.Interface.Item2D,  action: SetSize,  line: 912 
   file: CodeEditor.quorum,  class: Libraries.Interface.Controls.Blocks.CodeEditor,  action: SetSize,  line: -1 
   file: FlowLayout.quorum,  class: Libraries.Interface.Layouts.FlowLayout,  action: DefaultLayoutItem,  line: 339 
   file: FlowLayout.quorum,  class: Libraries.Interface.Layouts.FlowLayout,  action: LayoutItems,  line: 207 
   file: FlowLayout.quorum,  class: Libraries.Interface.Layouts.FlowLayout,  action: Layout,  line: 68 
   file: Item2D.quorum,  class: Libraries.Interface.Item2D,  action: Resize,  line: 4806 
   file: TabViewArea.quorum,  class: Libraries.Interface.Controls.TabViewArea,  action: Resize,  line: -1 
   file: Item2D.quorum,  class: Libraries.Interface.Item2D,  action: SetSize,  line: 912 
   file: TabViewArea.quorum,  class: Libraries.Interface.Controls.TabViewArea,  action: SetSize,  line: -1 
   file: FlowLayout.quorum,  class: Libraries.Interface.Layouts.FlowLayout,  action: DefaultLayoutItem,  line: 339 
   file: FlowLayout.quorum,  class: Libraries.Interface.Layouts.FlowLayout,  action: LayoutItems,  line: 207 
   file: FlowLayout.quorum,  class: Libraries.Interface.Layouts.FlowLayout,  action: Layout,  line: 68 
   file: Item2D.quorum,  class: Libraries.Interface.Item2D,  action: Resize,  line: 4806 
   file: CodeEditorTabPane.quorum,  class: Libraries.Development.Environment.Studio.CodeEditorTabPane,  action: Resize,  line: -1 
   file: TabPane.quorum,  class: Libraries.Interface.Controls.TabPane,  action: SetCurrentItem,  line: 106 
   file: CodeEditorTabPane.quorum,  class: Libraries.Development.Environment.Studio.CodeEditorTabPane,  action: SetCurrentItem,  line: -1 
   file: TabPane.quorum,  class: Libraries.Interface.Controls.TabPane,  action: UpdateSelection,  line: 235 
   file: CodeEditorTabPane.quorum,  class: Libraries.Development.Environment.Studio.CodeEditorTabPane,  action: UpdateSelection,  line: -1 
   file: Tab.quorum,  class: Libraries.Interface.Controls.Tab,  action: OnToggleOn,  line: 282 
   file: EditorTab.quorum,  class: Libraries.Development.Environment.Studio.Interface.EditorTab,  action: OnToggleOn,  line: 130 
   file: Tab.quorum,  class: Libraries.Interface.Controls.Tab,  action: SetToggleState,  line: 219 
   file: EditorTab.quorum,  class: Libraries.Development.Environment.Studio.Interface.EditorTab,  action: SetToggleState,  line: -1 
   file: TabPane.quorum,  class: Libraries.Interface.Controls.TabPane,  action: Select,  line: 181 
   file: CodeEditorTabPane.quorum,  class: Libraries.Development.Environment.Studio.CodeEditorTabPane,  action: Select,  line: -1 
   file: TabPane.quorum,  class: Libraries.Interface.Controls.TabPane,  action: Select,  line: 197 
   file: CodeEditorTabPane.quorum,  class: Libraries.Development.Environment.Studio.CodeEditorTabPane,  action: Select,  line: -1 
   file: TabPane.quorum,  class: Libraries.Interface.Controls.TabPane,  action: Select,  line: 189 
   file: CodeEditorTabPane.quorum,  class: Libraries.Development.Environment.Studio.CodeEditorTabPane,  action: Select,  line: -1 
   file: OpenTabBehavior.quorum,  class: Libraries.Development.Environment.Studio.Behaviors.OpenTabBehavior,  action: Run,  line: 31 
   file: Control.quorum,  class: Libraries.Interface.Controls.Control,  action: Activate,  line: 296 
   file: ProjectTreeItem.quorum,  class: Libraries.Development.Environment.Projects.ProjectTreeItem,  action: Activate,  line: -1 
   file: Control.quorum,  class: Libraries.Interface.Controls.Control,  action: Activate,  line: 287 
   file: ProjectTreeItem.quorum,  class: Libraries.Development.Environment.Projects.ProjectTreeItem,  action: Activate,  line: -1 
   file: TreeItem.quorum,  class: Libraries.Interface.Controls.TreeItem,  action: OnDoubleClick,  line: 378 
   file: ProjectTreeItem.quorum,  class: Libraries.Development.Environment.Projects.ProjectTreeItem,  action: OnDoubleClick,  line: -1 
   file: TreeDoubleClickBehavior.quorum,  class: Libraries.Interface.Behaviors.Controls.TreeDoubleClickBehavior,  action: Run,  line: 11 
   file: InputTable.quorum,  class: Libraries.Game.InputTable,  action: ProcessInput,  line: 75 
   file: StandardInput.quorum,  class: Libraries.Game.StandardInput,  action: ProcessInputEvents,  line: 459 
   file: DesktopInput.quorum,  class: Libraries.Game.DesktopInput,  action: ProcessInputEvents,  line: -1 
   file: Game.quorum,  class: Libraries.Game.Game,  action: ContinueGame,  line: 781 
   file: QuorumStudio.quorum,  class: Libraries.Development.Environment.Studio.QuorumStudio,  action: ContinueGame,  line: -1 
   file: DesktopApplication.quorum,  class: Libraries.Game.DesktopApplication,  action: MainLoop,  line: 115 
   file: DesktopApplication.quorum,  class: Libraries.Game.DesktopApplication,  action: Setup,  line: 44 
   file: Game.quorum,  class: Libraries.Game.Game,  action: CompleteInitialSetup,  line: 472 
   file: QuorumStudio.quorum,  class: Libraries.Development.Environment.Studio.QuorumStudio,  action: CompleteInitialSetup,  line: -1 
   file: Game.quorum,  class: Libraries.Game.Game,  action: StartGame,  line: 328 
   file: QuorumStudio.quorum,  class: Libraries.Development.Environment.Studio.QuorumStudio,  action: StartGame,  line: -1 
   file: QuorumStudio.quorum,  class: Libraries.Development.Environment.Studio.QuorumStudio,  action: Start,  line: 181 
   file: main.quorum,  class: Main,  action: Main,  line: 10 
andreas-stefik commented 11 months ago

Fixed. Turned out to be a parser bug. After I run the test suite and test whether I broke anything in the process, I'll put this one on the Quorum-11 branch.

andreas-stefik commented 11 months ago

Fixed.