Skip to content

fix: normalize BrightScript hex literals in enum/const values#15

Merged
markwpearce merged 2 commits into
v1from
fix/hex-literal-jsdoc-v1
Jul 23, 2026
Merged

fix: normalize BrightScript hex literals in enum/const values#15
markwpearce merged 2 commits into
v1from
fix/hex-literal-jsdoc-v1

Conversation

@markwpearce

Copy link
Copy Markdown
Owner

Summary

  • processEnum and processConst emit raw BrightScript literal source text (e.g. &hFF0000FF) verbatim into the generated pseudo-JS
  • &h... isn't valid JS, so jsdoc's parser throws and doc generation fails for the whole file
  • Normalize &hHEX tokens to 0xHEX before emitting, in both processEnum and processConst

Test plan

  • npm run build
  • npm run lint
  • npm test (added coverage for hex literals in enum members and const values)

Fixes #14

enumMember.getValue() and const literal tokens emit raw BrightScript
source text (e.g. &hFF0000FF), which isn't valid JS and crashes
jsdoc's parser for the whole file. Convert &hHEX to 0xHEX before
emitting.

Fixes #14
Exercises the &h hex literal normalization fix via npm run testdocs.
@markwpearce
markwpearce merged commit fe8222c into v1 Jul 23, 2026
2 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