Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite loop in processRule() #74

Open
EliotVU opened this issue Jan 27, 2023 · 0 comments
Open

Infinite loop in processRule() #74

EliotVU opened this issue Jan 27, 2023 · 0 comments

Comments

@EliotVU
Copy link

EliotVU commented Jan 27, 2023

Hello, your library has been of great use to assist with implementing auto-completion for an old language called "UnrealScript".

However, in UnrealScript we will often stumble on pieces of C++ text blocks, which I solved with the following grammar:

cppText
	: 'cpptext' exportBlockText
	;

// Skips a C++ block of text: "{ ... | { ... }* }
exportBlockText
	: OPEN_BRACE (~(OPEN_BRACE | CLOSE_BRACE)+ | exportBlockText)* CLOSE_BRACE
	;

UCParser.g4#L598

This had worked flawlessly except for c3. When c3 hits the first instance of 'exportBlockText' it will run in an infinite loop with 'processRule'. That may seem obvious given the grammar, any chance this could be fixed, or a possible work around?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants