robertkrimen / otto

A JavaScript interpreter in Go (golang)
http://godoc.org/github.com/robertkrimen/otto
MIT License
8.01k stars 584 forks source link

parser/lexer: correct ID_Start & ID_Continue checks #524

Closed filips closed 2 months ago

filips commented 2 months ago

unicode.IsLetter and unicode.IsDigit will not return the complete set of ID_Start and ID_Continue characters defined here: https://www.unicode.org/reports/tr31/.

filips commented 2 months ago

Looks reasonable but lets get some tests which exercise this.

I added a few tests for the areas where the allowed character sets differ. Please let me know if you want me to add further tests.

filips commented 2 months ago

@stevenh Linter warnings should be fixed now

filips commented 2 months ago

Thanks for this, just a minor nit and then good to go.

Sure thing, I pushed with the methods unexported