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 22build
33script
44examples
5-
5+ target
Original file line number Diff line number Diff line change 11[package ]
22name = " tree-sitter-rust"
33description = " Rust grammar for the tree-sitter parsing library"
4- version = " 0.16 .0"
4+ version = " 0.19 .0"
55authors = [" Max Brunsfeld <maxbrunsfeld@gmail.com>" ]
66license = " MIT"
77readme = " bindings/rust/README.md"
@@ -23,7 +23,7 @@ autoexamples = false
2323path = " bindings/rust/lib.rs"
2424
2525[dependencies ]
26- tree-sitter = " 0.17 "
26+ tree-sitter = " 0.19 "
2727
2828[build-dependencies ]
2929cc = " 1.0"
Original file line number Diff line number Diff line change 99 "sources" : [
1010 "src/parser.c" ,
1111 "src/scanner.c" ,
12- "src /binding.cc"
12+ "bindings/node /binding.cc"
1313 ],
1414 "cflags_c" : [
1515 "-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-
41fn 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
106 . flag_if_supported ( "-Wno-unused-parameter" )
117 . flag_if_supported ( "-Wno-unused-but-set-variable" )
128 . flag_if_supported ( "-Wno-trigraphs" ) ;
139 let parser_path = src_dir. join ( "parser.c" ) ;
14- c_config. file ( & parser_path) ;
1510 let scanner_path = src_dir. join ( "scanner.c" ) ;
16- c_config. file ( & scanner_path) ;
1711 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" ) ;
1916}
Original file line number Diff line number Diff line change @@ -1432,7 +1432,7 @@ module.exports = grammar({
14321432 $ . scoped_identifier
14331433 ) ,
14341434
1435- identifier : $ => / ( r # ) ? [ a - z A - Z α - ω Α - Ω µ _ ] [ a - z A - Z α - ω Α - Ω µ \d _ ] * / ,
1435+ identifier : $ => / ( r # ) ? [ _ \p { XID_Start } ] [ _ \p { XID_Continue } ] * / ,
14361436
14371437 _reserved_identifier : $ => alias ( choice (
14381438 'default' ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 22 "name" : " tree-sitter-rust" ,
33 "version" : " 0.17.0" ,
44 "description" : " Rust grammar for tree-sitter" ,
5- "main" : " index.js " ,
5+ "main" : " bindings/node " ,
66 "keywords" : [
77 " parser" ,
88 " rust"
99 ],
1010 "author" : " Maxim Sokolov <maxim0xff@gmail.com> (https://github.com/MaximSokolov)" ,
1111 "license" : " MIT" ,
1212 "dependencies" : {
13- "nan" : " ^2.8 .0"
13+ "nan" : " ^2.14 .0"
1414 },
1515 "devDependencies" : {
16- "tree-sitter-cli" : " ^0.17.3 "
16+ "tree-sitter-cli" : " ^0.19.1 "
1717 },
1818 "scripts" : {
1919 "test" : " tree-sitter test && script/parse-examples" ,
Original file line number Diff line number Diff line change 82188218 },
82198219 "identifier" : {
82208220 "type" : " PATTERN" ,
8221- "value" : " (r#)?[a-zA-Zα-ωΑ-Ωµ_][a-zA-Zα-ωΑ-Ωµ \\ d_ ]*"
8221+ "value" : " (r#)?[_ \\ p{XID_Start}][_ \\ p{XID_Continue} ]*"
82228222 },
82238223 "_reserved_identifier" : {
82248224 "type" : " ALIAS" ,
83138313 " for_lifetimes"
83148314 ]
83158315 ],
8316+ "precedences" : [],
83168317 "externals" : [
83178318 {
83188319 "type" : " SYMBOL" ,
You can’t perform that action at this time.
0 commit comments