From 415df969c7d028046a18ccac34d4ead4798d9af8 Mon Sep 17 00:00:00 2001 From: pzinn Date: Mon, 9 Sep 2024 09:04:42 +1000 Subject: [PATCH] add symbols file for Macaulay2Web --- M2/Macaulay2/editors/Macaulay2Web/M2-symbols.ts.in | 1 + M2/Macaulay2/editors/make-M2-symbols.m2 | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 M2/Macaulay2/editors/Macaulay2Web/M2-symbols.ts.in diff --git a/M2/Macaulay2/editors/Macaulay2Web/M2-symbols.ts.in b/M2/Macaulay2/editors/Macaulay2Web/M2-symbols.ts.in new file mode 100644 index 0000000000..6ed5cdf49d --- /dev/null +++ b/M2/Macaulay2/editors/Macaulay2Web/M2-symbols.ts.in @@ -0,0 +1 @@ +export default [@M2SYMBOLS@]; diff --git a/M2/Macaulay2/editors/make-M2-symbols.m2 b/M2/Macaulay2/editors/make-M2-symbols.m2 index ad1c484653..2f74788b1d 100644 --- a/M2/Macaulay2/editors/make-M2-symbols.m2 +++ b/M2/Macaulay2/editors/make-M2-symbols.m2 @@ -151,6 +151,12 @@ symbolsForTextMate = template -> ( output = replace("@M2CONSTANTS@", demark("|", CONSTANTS), output); output) +symbolsForMacaulay2Web = template -> ( + output := concatenate("// ", banner, newline, newline, template); + output = replace("@M2VERSION@", version#"VERSION", output); + output = replace("@M2SYMBOLS@", demark(",", format \ SYMBOLS), output); + output) + ------------------------------------------------------------------------------- -- Generate syntax files from templates in the same directory @@ -187,6 +193,10 @@ generateGrammar("highlightjs/macaulay2.js", symbolsForHighlightJS) generateGrammar("textmate/macaulay2.tmLanguage.json", symbolsForTextMate) +-- Macaulay2Web: Write M2-symbols.ts +generateGrammar("Macaulay2Web/M2-symbols.ts", symbolsForMacaulay2Web) + + -- Local Variables: -- compile-command: "make -C $M2BUILDDIR/Macaulay2/emacs M2-symbols " -- End: