Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regex [(] is valid but compiler throws #1

Open
TheFireBlast opened this issue Jul 13, 2022 · 0 comments
Open

Regex [(] is valid but compiler throws #1

TheFireBlast opened this issue Jul 13, 2022 · 0 comments

Comments

@TheFireBlast
Copy link
Owner

TypeError: reduce of empty array with no initial value

let totalGroups = groups.reduce((a, b) => a + b);

getRegexGroups doesn't escape parenthesis inside a character class and returns an empty array.

since validateRegexAndStyleList expects getRegexGroups to return at least one capture group, it throws.

name = foo

contexts [] {
main : context {
	: pattern {
		regex		\= ([(])
		styles []	 = .foo;
	}
}
}
styles [] {
.foo : style {
	color			 = #CCCCCC
	textmate_scope	 = string
}
}
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

No branches or pull requests

1 participant