-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hello,
I have been playing with the package recently and I have experienced some issues.
The program seems to struggle with larger texts. At first I suspected, there might be an unreasonable amount of copying involved. After some debugging, I've came to conclusion, that this is in fact a problem with stack related to usage of recursion.
Reproduction example:
let grammar = Grammar(start: "initial") {
"initial" --> n("initial") <+> t("a")
<|> t()
}
let parser = EarleyParser(grammar: grammar)
let text = String.init(repeating: "a", count: 2500)
let syntaxTree = try parser.syntaxTree(for: text )
I'm trying to work with files aroung 10K characters. At this time, I am able to work with 2000 characters long texts using this simple grammar.
For the time being, I will try to find a workaroud. I might have time to fix the issue in the future.
Metadata
Metadata
Assignees
Labels
No labels