roblox-aurora / zirconium

Runtime scripting language for Roblox.
22 stars 2 forks source link

Script execution timeout when typing `Question` mark on a command box #13

Closed memothelemo closed 2 years ago

memothelemo commented 3 years ago

When I type question mark in Zircon console, it almost crashed ROBLOX Studio because of exhausted allowed execution time. I don't know if something goes wrong with the lexer or the parser itself?

Traceback:

ReplicatedStorage.rbxts_include.node_modules.zirconium.out.Ast.Lexer:183: Script timeout: exhausted allowed execution time  -  Client - Lexer:80
  15:09:17.923  Stack Begin  -  Studio
  15:09:17.923  Script 'ReplicatedStorage.rbxts_include.node_modules.zirconium.out.Ast.Lexer', Line 80 - function readWhile  -  Studio - Lexer:80
  15:09:17.923  Script 'ReplicatedStorage.rbxts_include.node_modules.zirconium.out.Ast.Lexer', Line 183 - function readLiteralString  -  Studio - Lexer:183
  15:09:17.924  Script 'ReplicatedStorage.rbxts_include.node_modules.zirconium.out.Ast.Lexer', Line 452 - function readNext  -  Studio - Lexer:452
  15:09:17.924  Script 'ReplicatedStorage.rbxts_include.node_modules.zirconium.out.Ast.Lexer', Line 516 - function fetchNextToken  -  Studio - Lexer:516
  15:09:17.924  Script 'ReplicatedStorage.rbxts_include.node_modules.zirconium.out.Ast.Lexer', Line 568 - function next  -  Studio - Lexer:568
  15:09:17.924  Script 'ReplicatedStorage.rbxts_include.node_modules.zirconium.out.Ast.Syntax.RichTextHighlighter', Line 52 - function parse  -  Studio - RichTextHighlighter:52
  15:09:17.925  Script 'ReplicatedStorage.rbxts_include.node_modules.zircon.out.Client.Components.SyntaxTextBox', Line 135  -  Studio - SyntaxTextBox:135
  15:09:17.925  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.createContext', Line 87 - function render  -  Studio - createContext:87
  15:09:17.925  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.Component', Line 494 - function __resolveUpdate  -  Studio - Component:494
  15:09:17.926  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.Component', Line 435 - function __update  -  Studio - Component:435
  15:09:17.926  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.createReconciler', Line 238 - function updateVirtualNode  -  Studio - createReconciler:238
  15:09:17.926  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.createReconciler', Line 72 - function updateChildren  -  Studio - createReconciler:72
  15:09:17.927  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.createReconciler', Line 119 - function updateVirtualNodeWithRenderResult  -  Studio - createReconciler:119
  15:09:17.927  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.Component', Line 497 - function __resolveUpdate  -  Studio - Component:497
  15:09:17.927  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.Component', Line 435 - function __update  -  Studio - Component:435
  15:09:17.927  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.Component', Line 161 - function setState  -  Studio - Component:161
  15:09:17.928  Script 'ReplicatedStorage.rbxts_include.node_modules.zircon.out.Client.Components.SyntaxTextBox', Line 99  -  Studio - SyntaxTextBox:99
  15:09:17.928  Script 'ReplicatedStorage.rbxts_include.node_modules.roact.src.SingleEventManager', Line 83  -  Studio - SingleEventManager:83
  15:09:17.928  Stack End  -  Studio
Vorlias commented 3 years ago

It's a Lexer issue (specifically with the built-in Zirconium syntax highlighter itself) and I've ran into it before so I'll fix it at some point.

Vorlias commented 2 years ago

Apologies for the really late response. Been quite a year.

As far as I've discerned, the affected tokens are: ~, ?, ^, % and `. I will be setting these as special tokens.