apushkarev / Krpano-Markup-Language

Syntax definition for SublimeText 3
33 stars 11 forks source link

krpano-tmLanguage regular expressions #2

Open RafaelGPaz opened 6 years ago

RafaelGPaz commented 6 years ago

Hello! I'm working on a Krpano Markup Languge too, but for the VSCode editor. I managed to get the syntax highlight working by using your krpano-tmLanguage file. You have done a great job implementing the Krpano syntax definitions! So good that I wonder, how did you managed to write all the regular expressions for it. Did you do it by hand? I noticed that there a few elements missing, and I'd like to upgrade it to include everything. I might ask for some help to Klaus, the Krpano developer.

Quick question. I don't understand why you used the expression underneath in krpanoElementProperties and krpanoConstants

(?<!\\-)

It matches any word which is not preceded by a dash symbol. Correct? But when does it happen that in Krpano code?

apushkarev commented 6 years ago

I don't know how to insert replies here... so

I think you look in wrong file. The source is krpano.YAML-tmLanguage and it's converted to XML by Package Dev extension for ST3 The expression you mentioned never apperars in YAML file.

For future – please study YAML.

RafaelGPaz commented 6 years ago

Check the lines 140 and 151 in the file krpano.YAML-tmLanguage

(?<!\-)

How did you write the regular expressions? By hand, looking at the definitions in the Krpano Documentation mex pages?

apushkarev commented 6 years ago

It seems removing this expressions makes no effect at all :) I wrote YAML file by hand yes. There's a tip to get all krpano-relevant words: pasting content of entire doc page to text editor and careful study of this mess. :)