[pull] master from DCurrent:master - #96
Merged
Merged
Conversation
Replace whole-line `ArgList` collection for multi-value properties with sequential argument reading. * Read each argument directly from the source line into a reusable 64-byte buffer. * Remove aggregate `MAX_ARG_LEN` and `MAX_ARG_COUNT` limits from open-ended property lists. * Preserve quoting, comments, and the existing 63-character per-item limit. * Count weapon arguments before allocating the persistent weapon list exactly once. * Apply complete `allowselect` lists at runtime while retaining only whole entries that fit its legacy save field. * Keep the legacy 512-byte limit unchanged for general parsing, paths, save fields, and script file-stream arguments.
Store complete allowselect command lines in dynamically sized runtime and per-difficulty save state. Append length-prefixed allowselect data after the legacy fixed save records so current builds can round-trip lists of any practical size. Preserve a whole-argument compatibility mirror for older saves and older engine builds. Load the legacy fixed field when no dynamic extension is present, validate extension lengths against the remaining file, and release all owned state during save resets, level-order resizing, and shutdown.
Delete the fixed 1,024-byte compatibility mirror and fallback path. Require dynamic allowselect save data and advance the saved-game compatibility version so older record layouts are rejected.
Remove the fixed 512-byte findarg buffer and read requested file-stream arguments through the shared sequential token reader. Allocate script storage for only the requested argument, preserve missing-value conversions, and move model frame lookahead onto the same token reader.
Consume @cmd function names and parameters directly from the original command line one item at a time. This removes ParseArgs' whole-line and argument-count ceilings from generated script calls. Restore the dedicated per-command-argument buffer to 512 bytes for paths and other bounded values, and append function names directly to the dynamic script buffer.
Represent script string literals as non-owning pointer-and-length views through preprocessing and lexing, then materialize complete decoded values directly in StrCache when CONSTSTR instructions are emitted. Keep fixed token storage for identifiers and diagnostics only. Pass @cmd source tokens directly into its dynamic generated-script buffer so long quoted arguments do not pass through the 512-byte command scratch buffer. Preserve length-aware macro handling, escape behavior, switch-case lifetimes, and legacy unary-not string behavior.
Replace capacityless ScriptVariant_ToString() calls with explicit-capacity conversion or direct string views. Bound script string inputs and concatenation at 65,535 characters through MAX_SCRIPT_STRING_LENGTH, expose the limit to script, and reject oversized literals during compilation.
Treat matching single and double quotes as grouping syntax when parsing sequential command and file-stream arguments. * Remove opening and closing quote delimiters from decoded output. * Allow double-quoted spans to appear within arguments and concatenate with adjacent unquoted text. * Recognize single-quoted spans only at argument boundaries, preserving apostrophes in ordinary words. * Preserve the opposite quote type as literal content within a quoted span. * Allow quoted file-stream arguments to contain whitespace, comment markers, and newlines. * Support empty quoted arguments. * Track source and decoded lengths separately to avoid unnecessary temporary allocations. * Decode file-stream arguments directly into exact-sized script string storage. * Apply the 65,535-character policy to decoded content. * Reject unterminated quotes and insufficient destination capacity cleanly. File streams can now return complete sentences and multi-line paragraphs as individual arguments without retaining their grouping delimiters.
Prevent `nocmdcompatible` optimization from corrupting generated animation scripts when same-frame `@cmd` calls are separated by other script content. * Track whether the preceding generated section is eligible for `@cmd` merging. * Invalidate merge eligibility after inline scripts, animation changes, and frame changes. * Verify the exact generated `return;` and frame-closing suffix before removing either. * Remove the complete suffix atomically only after successful validation. * Open a fresh frame condition when the preceding output is not safely mergeable. * Preserve normal merging of adjacent same-frame `@cmd` calls. This prevents intervening `@script` content or unexpected generated output from being truncated while retaining the existing compatibility optimization.
The implementation removes the intended aggregate limits while preserving deliberate per-value bounds and existing compatibility behavior where required. Malformed quotations now fail cleanly, script strings are consistently bounded, and `nocmdcompatible` retains its optimization without risking generated-script corruption. Regression coverage includes sequential properties, dynamic `allowselect` storage, file-stream decoding, quoted `@cmd` arguments, malformed input, same-frame merging, intervening script content, frame and animation transitions, string boundaries, text rendering, and high argument counts. All local checks pass, and GitHub Actions is green across macOS, Ubuntu x64, Android arm64, and Windows x64.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )