Lark: Syntax highlighting for grammar files?

Created on 23 Apr 2018  路  5Comments  路  Source: lark-parser/lark

Hi, sorry if this is a dumb question, but is there any way I could get syntax highlighting and/or linting for writing the grammar files (in sublime, or some other editor)? I often find code much easier to debug and learn with this.

Most helpful comment

@RyannDaGreat since more has been done since you originally posted this issue, you can currently get the highlighting in Sublime by Adding this Repository to Package Control and then installing the lark_syntax package. I don't think it has been added to the Package Control global repo yet, so for now you'll just have to do it this way. You'll also need to change your file extension to .lark, which is the new file extension.

All 5 comments

Great question, this is still work in progress. We're talking about it in issue #116.

@RyannDaGreat since more has been done since you originally posted this issue, you can currently get the highlighting in Sublime by Adding this Repository to Package Control and then installing the lark_syntax package. I don't think it has been added to the Package Control global repo yet, so for now you'll just have to do it this way. You'll also need to change your file extension to .lark, which is the new file extension.

@RobRoseKnows Thanks, that package is quite nice, little note though, if you also want to syntax highlight .g files (used currently on the lark examples), just modify Data\Packages\Lark Grammar Syntax\lark.tmLanguage and add:

<key>fileTypes</key>
<array>
    <string>g</string>
    <string>lark</string>
    <string>lr</string>
</array>

@brupelo That's temporary. The extensions in the example will soon change to .lark.

Closing this issue. Syntax highlighters can be found here: https://github.com/lark-parser

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aravindkumaremis picture aravindkumaremis  路  4Comments

aravindkumaremis picture aravindkumaremis  路  6Comments

giuliano-oliveira picture giuliano-oliveira  路  7Comments

Zac-HD picture Zac-HD  路  5Comments

solartes picture solartes  路  5Comments