pvl / abap.tmbundle

TextMate support for ABAP
20 stars 9 forks source link

Use encoded < character in pragma regex #21

Closed lildude closed 6 years ago

lildude commented 6 years ago

πŸ‘‹ from the Linguist community.

If you're not already aware, this grammar is included in GitHub Linguist which is used for syntax highlighting ABAP on GitHub.com.

I'm the primary GitHub maintainer and am in the process of creating a new Linguist release (which involved pulling the latest version of this repo) when I noticed that your grammar has changed such that our grammar compiler has detected a problem that prevents the grammar from being compiled:

Grammar conversion failed. File `Syntaxes/ABAP.tmLanguage` failed to parse: XML syntax error on line 50: invalid <![ sequence

This is the regex on line 50:

https://github.com/pvl/abap.tmbundle/blob/221919d83c0342332e4b42c473cfd598ae0565f2/Syntaxes/ABAP.tmLanguage#L50

... introduced in https://github.com/pvl/abap.tmbundle/pull/14.

The problem? < is not valid in an XML document and should be encoded.

This PR does just that and encodes < to &lt;.

If you're quick to merge this, I can ensure it's included in the next release of Linguist and thus GitHub.com.

larshp commented 6 years ago

thanks, merged

do you have any recommendations for setting up CI to check if the grammar is valid?

lildude commented 6 years ago

thanks, merged

Woohoo!!! πŸŽ‰. Thanks.

do you have any recommendations for setting up CI to check if the grammar is valid?

Unfortunately not. TextMate didn't seem to think of automated testing when it came to allowing people to write their own grammars so haven't really provided any guidelines or native methods to do so.

Our grammar compiler only really does basic key and syntax checking. You may be able to adapt this for your own purposes.