allow up to 65536 parser events

parser events don't take up enough memory to warrant a stricter limit.
I do wonder if this limit is actually reachable with a 65536 character limit though.
This commit is contained in:
liquidex 2024-09-04 22:11:24 +02:00
parent 5e6b84bed5
commit d309211558
2 changed files with 5 additions and 1 deletions

View file

@ -37,6 +37,9 @@ enum EventKind {
Advance,
}
// We don't want events taking up too much memory all of a sudden.
const _: () = assert!(size_of::<EventKind>() == 1);
struct Open {
index: Option<usize>,
}

View file

@ -73,7 +73,8 @@ max_defs = 256
max_tokens = 4096
# Maximum amount of events that the parser may emit in a single chunk.
max_parser_events = 4096
# These don't take up that much memory (a byte per event), so having many of these isn't a big deal.
max_parser_events = 65536
# Maximum amount of AST nodes in a single parse.
ast_capacity = 4096