|
Post by xenos1984 on Jan 3, 2016 10:21:02 GMT -8
If anyone happens to use vim for writing GDL files, maybe this syntax file could be useful: github.com/xenos1984/syntax/blob/master/vim/gdl.vimI didn't find any GDL syntax for vim implemented already, so I just made this one. So far it's very basic, and I plan to extend it further. In particular, it should between the head and the body of a clause, and show an error, for example, if role appears as a head, or legal as a body, and so on. I'm not an expert on vim syntax files, and this is a quick hack for now, but maybe someone is interested in this.
|
|
|
Post by Andrew Rose on Jan 4, 2016 10:35:47 GMT -8
I take it you've seen Alex's Griddle plugin for Eclipse. The source is on GitHub, so you might find that gives you a leg-up with the parser. (Clearly the integration will be completely different.)
|
|
|
Post by xenos1984 on Jan 4, 2016 15:55:33 GMT -8
Thanks for the hint! Indeed, I've seen that, and installed it in Eclipse (but I'm not using Eclipse very much usually). I'll have a look at it.
|
|
|
Post by alandau on Jan 4, 2016 23:25:36 GMT -8
|
|
|
Post by xenos1984 on Jan 6, 2016 14:28:26 GMT -8
Hm... Looks like this is not so easy to implement in vim, at least not for me yet. The syntax highlighting is based on regex parsing, so one can easily analyze the lexical structure of the file. But advanced highlighting beyond that is tricky. In principle, vim's concept of "regions", within which syntax parsing and highlighting changes, turns it into some kind of state machine for syntax parsing, but I still need to dive deeper into this to make it work.
|
|