@stordata/grammars 1.0.20230421155415
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +13 -0
- package/.gitlab-ci.yml +49 -0
- package/.nvmrc +2 -0
- package/README.md +26 -0
- package/dist/main.cjs +2 -0
- package/dist/main.cjs.LICENSE.txt +1 -0
- package/generated/src/grammars/CustomMetric.interp +55 -0
- package/generated/src/grammars/CustomMetric.tokens +30 -0
- package/generated/src/grammars/CustomMetricLexer.interp +80 -0
- package/generated/src/grammars/CustomMetricLexer.js +94 -0
- package/generated/src/grammars/CustomMetricLexer.tokens +30 -0
- package/generated/src/grammars/CustomMetricListener.js +81 -0
- package/generated/src/grammars/CustomMetricParser.js +579 -0
- package/package.json +42 -0
- package/src/GrammarSyntaxError.js +10 -0
- package/src/ThrowingErrorListener.js +11 -0
- package/src/grammars/CustomMetric.g4 +38 -0
- package/src/grammars/parseCustomMetric.js +7 -0
- package/src/grammars/parseCustomMetric.spec.js +50 -0
- package/src/index.js +20 -0
- package/src/parse.js +18 -0
- package/src/walk.js +7 -0
- package/webpack.config.js +8 -0
package/.eslintrc.json
ADDED
package/.gitlab-ci.yml
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
image: docker.stordata.fr/stordata/docker-node:18
|
|
2
|
+
|
|
3
|
+
stages:
|
|
4
|
+
- antlr
|
|
5
|
+
- build
|
|
6
|
+
- release
|
|
7
|
+
|
|
8
|
+
antlr:
|
|
9
|
+
stage: antlr
|
|
10
|
+
image: docker.stordata.fr/stordata/docker-antlr
|
|
11
|
+
tags:
|
|
12
|
+
- docker
|
|
13
|
+
script:
|
|
14
|
+
- antlr4 -Dlanguage=JavaScript -o generated src/grammars/CustomMetric.g4
|
|
15
|
+
artifacts:
|
|
16
|
+
expire_in: 1h
|
|
17
|
+
paths:
|
|
18
|
+
- generated/
|
|
19
|
+
|
|
20
|
+
build:
|
|
21
|
+
stage: build
|
|
22
|
+
tags:
|
|
23
|
+
- docker
|
|
24
|
+
dependencies:
|
|
25
|
+
- antlr
|
|
26
|
+
script:
|
|
27
|
+
- npm ci
|
|
28
|
+
- npm run lint
|
|
29
|
+
- npm test
|
|
30
|
+
- npm run build
|
|
31
|
+
artifacts:
|
|
32
|
+
expire_in: 1h
|
|
33
|
+
paths:
|
|
34
|
+
- dist/
|
|
35
|
+
|
|
36
|
+
release:
|
|
37
|
+
stage: release
|
|
38
|
+
tags:
|
|
39
|
+
- docker
|
|
40
|
+
dependencies:
|
|
41
|
+
- antlr
|
|
42
|
+
- build
|
|
43
|
+
script:
|
|
44
|
+
- echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
|
|
45
|
+
- sed -i "s/\"version\":\s\"\(.*\..*\)\.\(.*\)\"/\"version\":\"\1.$(date +%Y%m%d%H%M%S)\"/" package.json
|
|
46
|
+
- npm publish
|
|
47
|
+
- git checkout .
|
|
48
|
+
rules:
|
|
49
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
package/.nvmrc
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# @stordata/grammars
|
|
2
|
+
|
|
3
|
+
A collection of ANTLR grammars used at Stordata.
|
|
4
|
+
This project exists so that we can package the grammars (and various utilities) as a CommonJS module.
|
|
5
|
+
The `antlr4` Javascript runtime is only available as an ES module at the time of writing.
|
|
6
|
+
|
|
7
|
+
## Pre-requisites
|
|
8
|
+
|
|
9
|
+
Install `antlr4-tools` Python package using `pip` with something like
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
pip install antlr4-tools
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
And verify that the `antlr4` command works. You might need to double-check that the command is in your path, pip installs
|
|
16
|
+
it in the `~/.local/bin` folder that is supposedly already handled by your Shell, but you know...
|
|
17
|
+
|
|
18
|
+
## Building
|
|
19
|
+
|
|
20
|
+
Available NPM scripts are
|
|
21
|
+
|
|
22
|
+
```
|
|
23
|
+
npm test
|
|
24
|
+
npm run lint
|
|
25
|
+
npm run build
|
|
26
|
+
```
|