diff --git a/crates/haku/src/parser.rs b/crates/haku/src/parser.rs index ae5511c..c8b89d2 100644 --- a/crates/haku/src/parser.rs +++ b/crates/haku/src/parser.rs @@ -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::() == 1); + struct Open { index: Option, } diff --git a/rkgk.toml b/rkgk.toml index 1c2b2ce..4681177 100644 --- a/rkgk.toml +++ b/rkgk.toml @@ -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