atom / language-coffee-script

CoffeeScript support in Atom
Other
59 stars 56 forks source link

Avoid using the ambiguous \h shorthand character #129

Closed pchaigno closed 7 years ago

pchaigno commented 7 years ago

Description of the Change

Depending on the regular expression engine used, \h does not always mean the same. With a PCRE engine, it matches white spaces, whereas, with a Oniguruma engine, it matches hexademical digit characters. Atom uses an Oniguruma engine, but github.com relies on a PCRE engine.

Alternate Designs

None were considered.

Benefits

Makes the grammar PCRE-compatible, so that it can be used on github.com.

Possible Drawbacks

I don't have any way to check these PCRE vs. Oniguruma discrepancies at the moment. I'm working on a new test at the Linguist-level to check for all known discrepancies.

pchaigno commented 7 years ago

The Travis build fail looks unrelated.

winstliu commented 7 years ago

That's a shame. I rather liked \h.

infininight commented 7 years ago

@pchaigno Believe this missed a usage of \h on line 399 and there is a attempted usage on line 108 but it has been improperly escaped.

pchaigno commented 7 years ago

@infininight #130 should fix it. Thanks!