Sublime Forum

Can someone explain to me the "syntax" and "embed" actions in .sublime-syntax?

#1

Three quick questions:
1 - The documentation for syntax definitions mentions once a syntax action, but never explains it. Is it the same as pushing another syntax file?
2 - Can someone explain to me the new embed action? As in, what arguments does it take and what does it do as opposed to the other actions?
3 - Just in case I’m missing something, are there any other actions available besides push, set, pop, syntax and embed?

1 Like

#2

There is also include which includes a context for matching at the current point in the stack. There are also commands for scoping, but I don’t know if they fall into your definition for “actions”. The syntax file document covers the commands pretty well.

0 Likes

#3

there is no syntax action. About embed, just be patient, as mentioned at


it will be explained/documented soon by Will and I imagine the syntaxes at https://github.com/sublimehq/Packages will shortly thereafter be updated to use it

1 Like

#4

http://www.sublimetext.com/docs/3/syntax.html

Search for “A match pattern can include the following keys:” Down there it says that “syntax” is a valid key inside a match. Is this an error in the docs then?

1 Like

#5

I’ve added some basic info about embed at Dev Build 3153.

0 Likes

#6

That does indeed seem wrong. I’ve never seen a key named “syntax”.

By thee way, when you update this, @wbond, please change the examples to use single-quoted strings since there are very limited situations where double quotes are preferred.

0 Likes

#7

Is there actually any situation at all where double quotes are preferred?

0 Likes

#8

Yes, when matching single quotes, I. E. "'" or in python, "'''".

0 Likes