From bf6d957d9d5936e1666137b798eeb7cda0828120 Mon Sep 17 00:00:00 2001 From: Reda Al Sulais Date: Sat, 12 Aug 2023 22:28:41 +0300 Subject: [PATCH] feat: add `info` langium parser --- .eslintignore | 2 + .gitignore | 3 + .prettierignore | 3 + cSpell.json | 1 + demos/info.html | 5 - package.json | 5 +- packages/mermaid/package.json | 2 + .../mermaid/src/diagrams/info/info.spec.ts | 21 +- .../mermaid/src/diagrams/info/infoDiagram.ts | 5 +- .../mermaid/src/diagrams/info/infoParser.ts | 20 + .../src/diagrams/info/parser/info.jison | 48 -- packages/parser/LICENSE | 21 + packages/parser/langium-config.json | 12 + packages/parser/package.json | 47 ++ packages/parser/src/index.ts | 1 + .../parser/src/language/common/common.langium | 20 + .../parser/src/language/common/commonLexer.ts | 7 + .../src/language/common/commonMatcher.ts | 14 + .../language/common/commonValueConverters.ts | 67 +++ packages/parser/src/language/common/index.ts | 2 + packages/parser/src/language/index.ts | 7 + packages/parser/src/language/info/index.ts | 3 + .../parser/src/language/info/info.langium | 12 + .../parser/src/language/info/infoModule.ts | 78 ++++ .../parser/src/language/info/infoParser.ts | 17 + .../src/language/info/infoTokenBuilder.ts | 23 + packages/parser/src/language/mermaid/index.ts | 2 + .../src/language/mermaid/mermaidModule.ts | 38 ++ .../mermaid/mermaidServiceRegistry.ts | 36 ++ packages/parser/tests/info.test.ts | 26 ++ packages/parser/tests/test-utils.ts | 15 + packages/parser/tsconfig.json | 12 + pnpm-lock.yaml | 438 +++++------------- vite.config.ts | 4 +- 34 files changed, 617 insertions(+), 400 deletions(-) create mode 100644 packages/mermaid/src/diagrams/info/infoParser.ts delete mode 100644 packages/mermaid/src/diagrams/info/parser/info.jison create mode 100644 packages/parser/LICENSE create mode 100644 packages/parser/langium-config.json create mode 100644 packages/parser/package.json create mode 100644 packages/parser/src/index.ts create mode 100644 packages/parser/src/language/common/common.langium create mode 100644 packages/parser/src/language/common/commonLexer.ts create mode 100644 packages/parser/src/language/common/commonMatcher.ts create mode 100644 packages/parser/src/language/common/commonValueConverters.ts create mode 100644 packages/parser/src/language/common/index.ts create mode 100644 packages/parser/src/language/index.ts create mode 100644 packages/parser/src/language/info/index.ts create mode 100644 packages/parser/src/language/info/info.langium create mode 100644 packages/parser/src/language/info/infoModule.ts create mode 100644 packages/parser/src/language/info/infoParser.ts create mode 100644 packages/parser/src/language/info/infoTokenBuilder.ts create mode 100644 packages/parser/src/language/mermaid/index.ts create mode 100644 packages/parser/src/language/mermaid/mermaidModule.ts create mode 100644 packages/parser/src/language/mermaid/mermaidServiceRegistry.ts create mode 100644 packages/parser/tests/info.test.ts create mode 100644 packages/parser/tests/test-utils.ts create mode 100644 packages/parser/tsconfig.json diff --git a/.eslintignore b/.eslintignore index 1db5125d093..6b2930ad5c0 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,3 +6,5 @@ cypress/plugins/index.js coverage *.json node_modules +# autogenereated by langium-cli +generated/ diff --git a/.gitignore b/.gitignore index 6a1cc85e516..ae435c33bc5 100644 --- a/.gitignore +++ b/.gitignore @@ -46,3 +46,6 @@ stats/ demos/dev/** !/demos/dev/example.html + +# autogenereated by langium-cli +generated/ diff --git a/.prettierignore b/.prettierignore index 8a9086315ef..af5c555393d 100644 --- a/.prettierignore +++ b/.prettierignore @@ -10,3 +10,6 @@ stats .nyc_output # Autogenerated by `pnpm run --filter mermaid types:build-config` packages/mermaid/src/config.type.ts + +# autogenereated by langium-cli +generated/ diff --git a/cSpell.json b/cSpell.json index 81ac90dc42d..e2c0b4d73e6 100644 --- a/cSpell.json +++ b/cSpell.json @@ -69,6 +69,7 @@ "knut", "knutsveidqvist", "laganeckas", + "langium", "linetype", "lintstagedrc", "logmsg", diff --git a/demos/info.html b/demos/info.html index affe9e59a1a..2b112c2838e 100644 --- a/demos/info.html +++ b/demos/info.html @@ -18,11 +18,6 @@

Info diagram demos

info -
-
-      info showInfo
-    
-