File tree Expand file tree Collapse file tree 12 files changed +5705
-366
lines changed Expand file tree Collapse file tree 12 files changed +5705
-366
lines changed Original file line number Diff line number Diff line change 2
2
build
3
3
script
4
4
examples
5
-
5
+ target
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " tree-sitter-rust"
3
3
description = " Rust grammar for the tree-sitter parsing library"
4
- version = " 0.16 .0"
4
+ version = " 0.19 .0"
5
5
authors = [
" Max Brunsfeld <[email protected] >" ]
6
6
license = " MIT"
7
7
readme = " bindings/rust/README.md"
@@ -23,7 +23,7 @@ autoexamples = false
23
23
path = " bindings/rust/lib.rs"
24
24
25
25
[dependencies ]
26
- tree-sitter = " 0.17 "
26
+ tree-sitter = " 0.19 "
27
27
28
28
[build-dependencies ]
29
29
cc = " 1.0"
Original file line number Diff line number Diff line change 9
9
"sources" : [
10
10
"src/parser.c" ,
11
11
"src/scanner.c" ,
12
- "src /binding.cc"
12
+ "bindings/node /binding.cc"
13
13
],
14
14
"cflags_c" : [
15
15
"-std=c99" ,
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ try {
2
+ module . exports = require ( "../../build/Release/tree_sitter_rust_binding" ) ;
3
+ } catch ( error1 ) {
4
+ if ( error1 . code !== 'MODULE_NOT_FOUND' ) {
5
+ throw error1 ;
6
+ }
7
+ try {
8
+ module . exports = require ( "../../build/Debug/tree_sitter_rust_binding" ) ;
9
+ } catch ( error2 ) {
10
+ if ( error2 . code !== 'MODULE_NOT_FOUND' ) {
11
+ throw error2 ;
12
+ }
13
+ throw error1
14
+ }
15
+ }
16
+
17
+ try {
18
+ module . exports . nodeTypeInfo = require ( "../../src/node-types.json" ) ;
19
+ } catch ( _ ) { }
Original file line number Diff line number Diff line change 1
- use std:: path:: Path ;
2
- extern crate cc;
3
-
4
1
fn main ( ) {
5
- let src_dir = Path :: new ( "src" ) ;
6
-
7
- let mut c_config = cc:: Build :: new ( ) ;
8
- c_config. include ( & src_dir) ;
9
- c_config
2
+ let src_dir = std:: path:: Path :: new ( "src" ) ;
3
+ let mut config = cc:: Build :: new ( ) ;
4
+ config. include ( & src_dir) ;
5
+ config
10
6
. flag_if_supported ( "-Wno-unused-parameter" )
11
7
. flag_if_supported ( "-Wno-unused-but-set-variable" )
12
8
. flag_if_supported ( "-Wno-trigraphs" ) ;
13
9
let parser_path = src_dir. join ( "parser.c" ) ;
14
- c_config. file ( & parser_path) ;
15
10
let scanner_path = src_dir. join ( "scanner.c" ) ;
16
- c_config. file ( & scanner_path) ;
17
11
println ! ( "cargo:rerun-if-changed={}" , parser_path. to_str( ) . unwrap( ) ) ;
18
- c_config. compile ( "parser-scanner" ) ;
12
+ println ! ( "cargo:rerun-if-changed={}" , scanner_path. to_str( ) . unwrap( ) ) ;
13
+ config. file ( & parser_path) ;
14
+ config. file ( & scanner_path) ;
15
+ config. compile ( "parser-scanner" ) ;
19
16
}
Original file line number Diff line number Diff line change @@ -1432,7 +1432,7 @@ module.exports = grammar({
1432
1432
$ . scoped_identifier
1433
1433
) ,
1434
1434
1435
- identifier : $ => / ( r # ) ? [ a - z A - Z α - ω Α - Ω µ _ ] [ a - z A - Z α - ω Α - Ω µ \d _ ] * / ,
1435
+ identifier : $ => / ( r # ) ? [ _ \p { XID_Start } ] [ _ \p { XID_Continue } ] * / ,
1436
1436
1437
1437
_reserved_identifier : $ => alias ( choice (
1438
1438
'default' ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 2
2
"name" : " tree-sitter-rust" ,
3
3
"version" : " 0.17.0" ,
4
4
"description" : " Rust grammar for tree-sitter" ,
5
- "main" : " index.js " ,
5
+ "main" : " bindings/node " ,
6
6
"keywords" : [
7
7
" parser" ,
8
8
" rust"
9
9
],
10
10
"author" :
" Maxim Sokolov <[email protected] > (https://github.com/MaximSokolov)" ,
11
11
"license" : " MIT" ,
12
12
"dependencies" : {
13
- "nan" : " ^2.8 .0"
13
+ "nan" : " ^2.14 .0"
14
14
},
15
15
"devDependencies" : {
16
- "tree-sitter-cli" : " ^0.17.3 "
16
+ "tree-sitter-cli" : " ^0.19.1 "
17
17
},
18
18
"scripts" : {
19
19
"test" : " tree-sitter test && script/parse-examples" ,
Original file line number Diff line number Diff line change 8218
8218
},
8219
8219
"identifier" : {
8220
8220
"type" : " PATTERN" ,
8221
- "value" : " (r#)?[a-zA-Zα-ωΑ-Ωµ_][a-zA-Zα-ωΑ-Ωµ \\ d_ ]*"
8221
+ "value" : " (r#)?[_ \\ p{XID_Start}][_ \\ p{XID_Continue} ]*"
8222
8222
},
8223
8223
"_reserved_identifier" : {
8224
8224
"type" : " ALIAS" ,
8313
8313
" for_lifetimes"
8314
8314
]
8315
8315
],
8316
+ "precedences" : [],
8316
8317
"externals" : [
8317
8318
{
8318
8319
"type" : " SYMBOL" ,
You can’t perform that action at this time.
0 commit comments