@ast-grep/lang-yaml 0.0.1 → 0.0.3

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/index.js CHANGED
@@ -1,8 +1,30 @@
1
1
  const path = require('node:path')
2
- const libPath = path.join(__dirname, 'parser.so')
2
+ const fs = require('node:fs')
3
+ const { resolvePrebuild } = require('@ast-grep/setup-lang')
4
+
5
+ function getLibPath() {
6
+ const prebuild = resolvePrebuild(__dirname)
7
+ if (prebuild) {
8
+ return prebuild
9
+ }
10
+
11
+ const native = path.join(__dirname, 'parser.so')
12
+ if (fs.existsSync(native)) {
13
+ return native
14
+ }
15
+
16
+ throw new Error('No parser found. Please ensure the parser is built or a prebuild is available.')
17
+ }
18
+
19
+ let libPath
3
20
 
4
21
  module.exports = {
5
- libraryPath: libPath,
22
+ get libraryPath() {
23
+ if (!libPath) {
24
+ libPath = getLibPath()
25
+ }
26
+ return libPath
27
+ },
6
28
  extensions: ['yaml', 'yml'],
7
29
  languageSymbol: 'tree_sitter_yaml',
8
30
  expandoChar: '$',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ast-grep/lang-yaml",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -18,10 +18,10 @@
18
18
  "author": "",
19
19
  "license": "ISC",
20
20
  "dependencies": {
21
- "@ast-grep/setup-lang": "0.0.3"
21
+ "@ast-grep/setup-lang": "0.0.4"
22
22
  },
23
23
  "peerDependencies": {
24
- "tree-sitter-cli": "0.24.6"
24
+ "tree-sitter-cli": "0.25.8"
25
25
  },
26
26
  "peerDependenciesMeta": {
27
27
  "tree-sitter-cli": {
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "devDependencies": {
32
- "@ast-grep/nursery": "0.0.2",
33
- "@tree-sitter-grammars/tree-sitter-yaml": "0.7.0",
34
- "tree-sitter-cli": "0.24.6"
32
+ "@ast-grep/nursery": "0.0.7",
33
+ "@tree-sitter-grammars/tree-sitter-yaml": "0.7.1",
34
+ "tree-sitter-cli": "0.25.8"
35
35
  },
36
36
  "publishConfig": {
37
37
  "access": "public",
package/src/grammar.json CHANGED
@@ -6047,6 +6047,15 @@
6047
6047
  "named": true,
6048
6048
  "value": "float_scalar"
6049
6049
  },
6050
+ {
6051
+ "type": "ALIAS",
6052
+ "content": {
6053
+ "type": "SYMBOL",
6054
+ "name": "_r_sgl_pln_tms_blk"
6055
+ },
6056
+ "named": true,
6057
+ "value": "timestamp_scalar"
6058
+ },
6050
6059
  {
6051
6060
  "type": "ALIAS",
6052
6061
  "content": {
@@ -6097,6 +6106,15 @@
6097
6106
  "named": true,
6098
6107
  "value": "float_scalar"
6099
6108
  },
6109
+ {
6110
+ "type": "ALIAS",
6111
+ "content": {
6112
+ "type": "SYMBOL",
6113
+ "name": "_br_sgl_pln_tms_blk"
6114
+ },
6115
+ "named": true,
6116
+ "value": "timestamp_scalar"
6117
+ },
6100
6118
  {
6101
6119
  "type": "ALIAS",
6102
6120
  "content": {
@@ -6147,6 +6165,15 @@
6147
6165
  "named": true,
6148
6166
  "value": "float_scalar"
6149
6167
  },
6168
+ {
6169
+ "type": "ALIAS",
6170
+ "content": {
6171
+ "type": "SYMBOL",
6172
+ "name": "_b_sgl_pln_tms_blk"
6173
+ },
6174
+ "named": true,
6175
+ "value": "timestamp_scalar"
6176
+ },
6150
6177
  {
6151
6178
  "type": "ALIAS",
6152
6179
  "content": {
@@ -6197,6 +6224,15 @@
6197
6224
  "named": true,
6198
6225
  "value": "float_scalar"
6199
6226
  },
6227
+ {
6228
+ "type": "ALIAS",
6229
+ "content": {
6230
+ "type": "SYMBOL",
6231
+ "name": "_r_sgl_pln_tms_flw"
6232
+ },
6233
+ "named": true,
6234
+ "value": "timestamp_scalar"
6235
+ },
6200
6236
  {
6201
6237
  "type": "ALIAS",
6202
6238
  "content": {
@@ -6247,6 +6283,15 @@
6247
6283
  "named": true,
6248
6284
  "value": "float_scalar"
6249
6285
  },
6286
+ {
6287
+ "type": "ALIAS",
6288
+ "content": {
6289
+ "type": "SYMBOL",
6290
+ "name": "_br_sgl_pln_tms_flw"
6291
+ },
6292
+ "named": true,
6293
+ "value": "timestamp_scalar"
6294
+ },
6250
6295
  {
6251
6296
  "type": "ALIAS",
6252
6297
  "content": {
@@ -6864,6 +6909,26 @@
6864
6909
  "type": "SYMBOL",
6865
6910
  "name": "_br_sgl_pln_flt_flw"
6866
6911
  },
6912
+ {
6913
+ "type": "SYMBOL",
6914
+ "name": "_r_sgl_pln_tms_blk"
6915
+ },
6916
+ {
6917
+ "type": "SYMBOL",
6918
+ "name": "_br_sgl_pln_tms_blk"
6919
+ },
6920
+ {
6921
+ "type": "SYMBOL",
6922
+ "name": "_b_sgl_pln_tms_blk"
6923
+ },
6924
+ {
6925
+ "type": "SYMBOL",
6926
+ "name": "_r_sgl_pln_tms_flw"
6927
+ },
6928
+ {
6929
+ "type": "SYMBOL",
6930
+ "name": "_br_sgl_pln_tms_flw"
6931
+ },
6867
6932
  {
6868
6933
  "type": "SYMBOL",
6869
6934
  "name": "_r_sgl_pln_str_blk"
@@ -6986,5 +7051,6 @@
6986
7051
  "_br_flw_njl_val_flw",
6987
7052
  "_r_sgl_flw_njl_val_flw"
6988
7053
  ],
6989
- "supertypes": []
6990
- }
7054
+ "supertypes": [],
7055
+ "reserved": {}
7056
+ }
@@ -328,6 +328,10 @@
328
328
  {
329
329
  "type": "string_scalar",
330
330
  "named": true
331
+ },
332
+ {
333
+ "type": "timestamp_scalar",
334
+ "named": true
331
335
  }
332
336
  ]
333
337
  }
@@ -482,7 +486,8 @@
482
486
  },
483
487
  {
484
488
  "type": "comment",
485
- "named": true
489
+ "named": true,
490
+ "extra": true
486
491
  },
487
492
  {
488
493
  "type": "directive_name",
@@ -524,6 +529,10 @@
524
529
  "type": "tag_prefix",
525
530
  "named": true
526
531
  },
532
+ {
533
+ "type": "timestamp_scalar",
534
+ "named": true
535
+ },
527
536
  {
528
537
  "type": "yaml_version",
529
538
  "named": true