Skip to content

Breaks BrighterScript regex literal on return statment #81

@chrisdp

Description

@chrisdp

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions