From 334e22dca9c6eea168e9d2b38198a29486b6dcac Mon Sep 17 00:00:00 2001 From: Jerome Lelong Date: Sat, 20 Apr 2024 14:55:08 +0200 Subject: [PATCH] Remove LaTeX3 grammar The LaTeX3 language now uses the standard latex grammar. --- dev/build-grammar.js | 1 - package.json | 23 ++++- syntax/LaTeX-Expl3.tmLanguage.json | 118 ------------------------- syntax/LaTeX.tmLanguage.json | 9 ++ syntax/TeX.tmLanguage.json | 2 +- syntax/src/LaTeX-Expl3.tmLanguage.yaml | 59 ------------- 6 files changed, 31 insertions(+), 181 deletions(-) delete mode 100644 syntax/LaTeX-Expl3.tmLanguage.json delete mode 100644 syntax/src/LaTeX-Expl3.tmLanguage.yaml diff --git a/dev/build-grammar.js b/dev/build-grammar.js index d4a4fcda3..88f4e1b6d 100644 --- a/dev/build-grammar.js +++ b/dev/build-grammar.js @@ -23,7 +23,6 @@ async function main() { 'src/BibTeX-style.tmLanguage.yaml', 'src/DocTeX.tmLanguage.yaml', 'src/JLweave.tmLanguage.yaml', - 'src/LaTeX-Expl3.tmLanguage.yaml', 'src/Pweave.tmLanguage.yaml', 'src/RSweave.tmLanguage.yaml' ] diff --git a/package.json b/package.json index d77d5a825..bdb947ee9 100644 --- a/package.json +++ b/package.json @@ -202,8 +202,27 @@ }, { "language": "latex-expl3", - "scopeName": "text.tex.latex.expl3", - "path": "./syntax/LaTeX-Expl3.tmLanguage.json" + "scopeName": "text.tex.latex", + "path": "./syntax/LaTeX.tmLanguage.json", + "embeddedLanguages": { + "source.asymptote": "asymptote", + "source.cpp": "cpp_embedded_latex", + "source.css": "css", + "source.dot": "dot", + "source.gnuplot": "gnuplot", + "text.html": "html", + "source.java": "java", + "source.js": "javascript", + "source.julia": "julia", + "source.lua": "lua", + "source.python": "python", + "source.ruby": "ruby", + "source.scala": "scala", + "source.ts": "typescript", + "text.xml": "xml", + "source.yaml": "yaml", + "meta.embedded.markdown_latex_combined": "markdown_latex_combined" + } }, { "language": "markdown_latex_combined", diff --git a/syntax/LaTeX-Expl3.tmLanguage.json b/syntax/LaTeX-Expl3.tmLanguage.json deleted file mode 100644 index 80a34e74f..000000000 --- a/syntax/LaTeX-Expl3.tmLanguage.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "name": "LaTeX-Expl3", - "patterns": [ - { - "begin": "(\\$\\$|\\$)", - "beginCaptures": { - "1": { - "name": "punctuation.section.group.begin.tex" - } - }, - "end": "(\\1)", - "endCaptures": { - "1": { - "name": "punctuation.section.group.end.tex" - } - }, - "name": "support.class.math.tex", - "patterns": [ - { - "match": "\\\\\\$", - "name": "constant.character.escape.tex" - }, - { - "include": "#latex3" - }, - { - "include": "text.tex#math" - }, - { - "include": "$base" - } - ] - }, - { - "begin": "\\\\\\(", - "beginCaptures": { - "0": { - "name": "punctuation.section.group.begin.tex" - } - }, - "end": "\\\\\\)", - "endCaptures": { - "0": { - "name": "punctuation.section.group.end.tex" - } - }, - "name": "support.class.math.tex", - "patterns": [ - { - "include": "#latex3" - }, - { - "include": "text.tex#math" - }, - { - "include": "$base" - } - ] - }, - { - "begin": "\\\\\\[", - "beginCaptures": { - "0": { - "name": "punctuation.section.group.begin.tex" - } - }, - "end": "\\\\\\]", - "endCaptures": { - "0": { - "name": "punctuation.section.group.end.tex" - } - }, - "name": "support.class.math.tex", - "patterns": [ - { - "include": "#latex3" - }, - { - "include": "text.tex#math" - }, - { - "include": "$base" - } - ] - }, - { - "include": "#latex3" - }, - { - "include": "text.tex.latex" - } - ], - "repository": { - "latex3": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.function.expl.latex" - } - }, - "match": "(\\\\|\\.)[\\w@]+:\\w*", - "name": "keyword.control.expl.latex" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.variable.expl.latex" - } - }, - "match": "(\\\\)[\\w@]+_[\\w@]+", - "name": "variable.expl.latex" - } - ] - } - }, - "scopeName": "text.tex.latex.expl3" -} \ No newline at end of file diff --git a/syntax/LaTeX.tmLanguage.json b/syntax/LaTeX.tmLanguage.json index c3b5619b1..f618b5eae 100644 --- a/syntax/LaTeX.tmLanguage.json +++ b/syntax/LaTeX.tmLanguage.json @@ -3035,6 +3035,15 @@ "match": "(\\\\)(text(s(terling|ixoldstyle|urd|e(ction|venoldstyle|rvicemark))|yen|n(ineoldstyle|umero|aira)|c(ircledP|o(py(left|right)|lonmonetary)|urrency|e(nt(oldstyle)?|lsius))|t(hree(superior|oldstyle|quarters(emdash)?)|i(ldelow|mes)|w(o(superior|oldstyle)|elveudash)|rademark)|interrobang(down)?|zerooldstyle|o(hm|ne(superior|half|oldstyle|quarter)|penbullet|rd(feminine|masculine))|d(i(scount|ed|v(orced)?)|o(ng|wnarrow|llar(oldstyle)?)|egree|agger(dbl)?|blhyphen(char)?)|uparrow|p(ilcrow|e(so|r(t(housand|enthousand)|iodcentered))|aragraph|m)|e(stimated|ightoldstyle|uro)|quotes(traight(dblbase|base)|ingle)|f(iveoldstyle|ouroldstyle|lorin|ractionsolidus)|won|l(not|ira|e(ftarrow|af)|quill|angle|brackdbl)|a(s(cii(caron|dieresis|acute|grave|macron|breve)|teriskcentered)|cutedbl)|r(ightarrow|e(cipe|ferencemark|gistered)|quill|angle|brackdbl)|g(uarani|ravedbl)|m(ho|inus|u(sicalnote)?|arried)|b(igcircle|orn|ullet|lank|a(ht|rdbl)|rokenbar)))\\b", "name": "constant.character.latex" }, + { + "captures": { + "1": { + "name": "punctuation.definition.variable.latex" + } + }, + "match": "(\\\\)[cgl](?:[_\\p{Alphabetic}@]+)+_(?:bitset|clist|dim|fp|int|muskip|str|tl|bool|box|coffin|flag|fparray|intarray|ior|iow|prop|regex|seq)", + "name": "variable.other.latex3.latex" + }, { "captures": { "1": { diff --git a/syntax/TeX.tmLanguage.json b/syntax/TeX.tmLanguage.json index 31e47ceab..bb936935e 100644 --- a/syntax/TeX.tmLanguage.json +++ b/syntax/TeX.tmLanguage.json @@ -101,7 +101,7 @@ "name": "punctuation.definition.function.tex" } }, - "match": "(\\\\)(?:[\\p{Alphabetic}@]+|[,;])", + "match": "(\\\\)(?:[,;]|(?:[\\p{Alphabetic}@]+(?:(?:_[\\p{Alphabetic}@]+)*:[NncVvoxefTFpwD]*)?))", "name": "support.function.general.tex" }, { diff --git a/syntax/src/LaTeX-Expl3.tmLanguage.yaml b/syntax/src/LaTeX-Expl3.tmLanguage.yaml deleted file mode 100644 index 61508bb03..000000000 --- a/syntax/src/LaTeX-Expl3.tmLanguage.yaml +++ /dev/null @@ -1,59 +0,0 @@ -name: LaTeX-Expl3 -patterns: -- begin: (\$\$|\$) - beginCaptures: - '1': - name: punctuation.section.group.begin.tex - end: (\1) - endCaptures: - '1': - name: punctuation.section.group.end.tex - name: support.class.math.tex - patterns: - - match: \\\$ - name: constant.character.escape.tex - - include: '#latex3' - - include: text.tex#math - - include: $base -- begin: \\\( - beginCaptures: - '0': - name: punctuation.section.group.begin.tex - end: \\\) - endCaptures: - '0': - name: punctuation.section.group.end.tex - name: support.class.math.tex - patterns: - - include: '#latex3' - - include: text.tex#math - - include: $base -- begin: \\\[ - beginCaptures: - '0': - name: punctuation.section.group.begin.tex - end: \\\] - endCaptures: - '0': - name: punctuation.section.group.end.tex - name: support.class.math.tex - patterns: - - include: '#latex3' - - include: text.tex#math - - include: $base -- include: '#latex3' -- include: text.tex.latex -repository: - latex3: - patterns: - - captures: - '1': - name: punctuation.definition.function.expl.latex - match: (\\|\.)[\w@]+:\w* - name: keyword.control.expl.latex - - captures: - '1': - name: punctuation.definition.variable.expl.latex - match: (\\)[\w@]+_[\w@]+ - name: variable.expl.latex -scopeName: text.tex.latex.expl3