Skip to content

Conversation

@ljunkie
Copy link
Member

@ljunkie ljunkie commented Nov 25, 2025

support @Stop and @{} resource replacements.

  • @Stop: treat the same as stop
  • @{}: treat as an identifier (variable) with a specific type ReplacementIdentifier

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds custom support for XELP resource replacement syntax in BrighterScript, introducing two new features: @stop as an alternative to the stop statement, and @{...} as replacement identifiers for resource placeholders. The implementation spans the lexer (tokenization), parser (AST generation), and type system (type assignment).

  • Adds lexer support for recognizing @stop and @{...} syntax patterns
  • Extends parser to handle @stop as a stop statement and @{...} as literal expressions
  • Assigns DynamicType to replacement identifiers since their actual types are unknown until resource replacement

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/lexer/Lexer.ts Adds tokenization logic for @stop (lines 165-170) and @{...} replacement identifiers (lines 163-164, 654-676)
src/lexer/TokenKind.ts Defines new token kinds: ReplacementIdentifier and AtStop
src/parser/Parser.ts Extends stop statement check to include AtStop, adds ReplacementIdentifier to primary expressions, fixes null check ordering (bug fix)
src/parser/tests/statement/Stop.spec.ts Adds tests for @stop and @STOP lexing and parsing
src/parser/tests/ReplacementIdentifier.spec.ts Comprehensive tests for @{...} syntax including nested identifiers and error cases
src/DiagnosticMessages.ts Adds error message for unterminated replacement identifiers
src/util.ts Maps ReplacementIdentifier tokens to DynamicType

@ljunkie ljunkie merged commit 31bdca0 into plexinc:xelp/main Nov 25, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant