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

[Lua] Lua syntax parsing process is very slow #4289

Open
Dongyang0810 opened this issue Oct 24, 2024 · 1 comment
Open

[Lua] Lua syntax parsing process is very slow #4289

Dongyang0810 opened this issue Oct 24, 2024 · 1 comment

Comments

@Dongyang0810
Copy link

sStream := antlr.NewInputStream(sInput)
aLexer := NewLuaLexer(sStream)
aTokens := antlr.NewCommonTokenStream(aLexer, antlr.TokenDefaultChannel)
aParser := NewLuaParser(aTokens)
aTree := aParser.Chunk()

sInputis the source code character stream, which has 2000 lines. The execution process of aParser.Chunk() is very slow. Is there any way to speed up the execution of this function?

@kaby76
Copy link
Contributor

kaby76 commented Oct 24, 2024

  • I cannot tell what target language you are using (Antlr4ng, Cpp, CSharp, Dart, Go, Java, JavaScript, PHP, Python3, Swift, TypeScript). (Likely Go, but I need confirmation.)
  • You don't provide any input file. What 2000-line file?

When posting an Issue, please provide a minimal reproducible example

Of the examples in the grammar for testing, none of these show any ambiguity, which is usually the first thing to look for. But, I can't tell without your input test.

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

No branches or pull requests

2 participants