Skip to content

Commit

Permalink
[TeX] Modifiers for \def's (#3593)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngc92 authored and deathaxe committed Nov 26, 2022
1 parent f459663 commit 8fc77a0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions LaTeX/TeX.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,11 @@ contexts:
1: punctuation.definition.backslash.tex
push: def-function-expect-identifier

- match: (\\)(?:outer|long|global){{endcs}}
scope: storage.modifier.definition.tex
captures:
1: punctuation.definition.backslash.tex

def-function-expect-identifier:
- meta_scope: meta.function.tex
- match: (?=\\)
Expand Down
21 changes: 21 additions & 0 deletions LaTeX/syntax_test_tex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,27 @@
\deftext
%^^^^^^^ support.function.general.tex

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Modifiers
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\long\def\test#1{#1}
%^^^^^ storage.modifier.definition.tex
%^ punctuation.definition.backslash.tex
% ^^^^ meta.function.tex keyword.declaration.function.tex storage.modifier.definition.tex

\outer\def\test#1{#1}
%^^^^^^ storage.modifier.definition.tex
%^ punctuation.definition.backslash.tex
% ^^^^ meta.function.tex keyword.declaration.function.tex storage.modifier.definition.tex

\global\def\test#1{#1}
%^^^^^^^ storage.modifier.definition.tex
%^ punctuation.definition.backslash.tex
% ^^^^ meta.function.tex keyword.declaration.function.tex storage.modifier.definition.tex




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Macro definition contents
Expand Down

0 comments on commit 8fc77a0

Please sign in to comment.