Sublime Forum

- Include: "#statement" and $apply in syntax file

#1

Hello everyone, my first post!

I was messing around with syntax and scope definitions and came across this weird - include statement in the MagicPython syntax file.
Q1
Why are they using - include ‘#statement’ ? does the # sign mean anything?
Q2
what is the repository? and what does the $apply statement mean?
Q3
where do i find documentation for this kind of stuff?

Thank you! pic is attached here

0 Likes

#2

- include: #something is the same as - include: something, the hash is normally preceded by a reference to a different syntax definition. Blank just still refers to the current one.

edit: just realized that is not a sublime-syntax file, its some yaml conversion of a legacy .tmLanguage. I suggest looking at the Python syntax that comes with ST instead.

0 Likes

#3

I just found this unofficial documentation:
http://docs.sublimetext.info/en/latest/reference/syntaxdefs.html#the-patterns-array

$self	    |   The current syntax definition.
#itemName	|   itemName in the repository.

I still don’t understand though. because this notation doesn’t even match yaml syntax.

0 Likes