Skip to content

Use $ for value variables and reserve @ for scene key references - #10

Closed
TiernanDeFranco wants to merge 3 commits into
mainfrom
codex/create-scene-parser-with-@-node-refs
Closed

TiernanDeFranco wants to merge 3 commits into
mainfrom
codex/create-scene-parser-with-@-node-refs

Conversation

@TiernanDeFranco

Copy link
Copy Markdown
Collaborator

Motivation

  • Standardize the scene format so that $ is used to declare and reference value variables while @ denotes scene key references like parents and keys.
  • Update serialization and parsing logic to match the new token semantics and reflect the change across resource files and tests.

Description

  • Add a Dollar token to the lexer and recognize $ as the prefix for value variables while keeping @ as a distinct token for key references.
  • Update the parser to treat $<name> as value variables and @<name> as SceneValue::Key, and adjust parsing of tags, var collection, and header variable handling accordingly.
  • Update the scene writer (SceneDocWriter) to emit $ for value vars and retain @ when writing parent/key references, and adjust dedupe variable emission to use $.
  • Modify resource scene files and unit tests to use the new $ variable syntax and to use @ for explicit key references where appropriate.

Testing

  • Ran the perro_scene unit test suite via cargo test -p perro_scene and all tests completed successfully.
  • Verified that serialization round-trips by parsing written scene text back with Parser::new(...).parse_scene() in tests and assertions passed.

Codex Task

@TiernanDeFranco
TiernanDeFranco deleted the codex/create-scene-parser-with-@-node-refs branch May 9, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant