@repometry/language-elixir 0.0.0 → 0.1.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@repometry/language-elixir",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Elixir for the Repometry tree-sitter plugin, with its grammar",
|
|
5
5
|
"license": "MIT AND Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"prepack": "npm run build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@repometry/core": "0.
|
|
42
|
-
"@repometry/tree-sitter": "0.
|
|
41
|
+
"@repometry/core": "0.7.0",
|
|
42
|
+
"@repometry/tree-sitter": "0.5.1"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export const elixirSyntax = {
|
|
2
|
+
lineComments: ['#'],
|
|
3
|
+
strings: [{ quote: '"' }, { quote: "'" }],
|
|
4
|
+
keywords: ['after', 'and', 'catch', 'do', 'else', 'end', 'false', 'fn', 'in', 'nil', 'not', 'or', 'rescue', 'true', 'when'],
|
|
5
|
+
};
|
|
6
|
+
//# sourceMappingURL=elixir-syntax.js.map
|
package/target/main/ts/elixir.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { measures } from '@repometry/tree-sitter';
|
|
2
2
|
import manifest from '../resources/grammar.json' with { type: 'json' };
|
|
3
|
+
import { elixirSyntax } from './elixir-syntax.js';
|
|
3
4
|
const functions = new Set(['def', 'defp', 'defmacro', 'defmacrop']);
|
|
4
5
|
const modules = new Set(['defmodule', 'defprotocol', 'defimpl']);
|
|
5
6
|
const comments = new Set(['comment']);
|
|
@@ -153,7 +154,7 @@ const matchArm = { decision: node => Number(patterns(node).some(item => item.typ
|
|
|
153
154
|
const guard = { decision: node => Number(operator(node) === 'when') };
|
|
154
155
|
const elseRule = { flow: 'else' };
|
|
155
156
|
export const elixir = {
|
|
156
|
-
language: { id: 'elixir', label: 'Elixir', color: '#6e4a7e', extensions: ['.ex', '.exs'], measures: [...measures, 'classes'] },
|
|
157
|
+
language: { id: 'elixir', label: 'Elixir', color: '#6e4a7e', extensions: ['.ex', '.exs'], measures: [...measures, 'classes'], syntax: elixirSyntax },
|
|
157
158
|
tool: { package: manifest.package, version: manifest.version },
|
|
158
159
|
asset: new URL('../resources/tree-sitter.wasm', import.meta.url),
|
|
159
160
|
prepareSource: text => text,
|