rokucommunity / rokucommunity/brighterscript-formatter
Breaks BrighterScript regex literal on return statment
Open
Nobody has claimed this yet.
bug
help wanted
- Dominant language
- TypeScript
- Stars
- 17
- Forks
- 10
- Avg merge
- 49m
- Merged PRs (30d)
- 7
Description
starting code examples:
function getRegex() as dynamic
regex = /([\xA9\xAE\x{2000}-\x{3300}\x{1F000}-\x{1FBFF}])/gmi
return regex
end function
function getRegex() as dynamic
return /([\xA9\xAE\x{2000}-\x{3300}\x{1F000}-\x{1FBFF}])/gmi
end function
after formatting:
function getRegex() as dynamic
regex = /([\xA9\xAE\x{2000}-\x{3300}\x{1F000}-\x{1FBFF}])/gmi
return regex
end function
function getRegex() as dynamic
return / ([ \ xA9 \ xAE \ x{ 2000 } - \ x{ 3300 } \ x{ 1F000 } - \ x{ 1FBFF }]) / gmi
end function
As you can see the second functions regex is mutated after formatting.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the formatter output using the two BrighterScript examples in the issue, then trace how a regex literal is handled when it appears directly after return. Done means formatting preserves the second function's regex exactly rather than inserting spaces or changing its escapes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100