This repository was archived by the owner on Apr 8, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -33,5 +33,5 @@ name = "snapshots"
3333path = " src/bin/snapshots.rs"
3434
3535[patch .'crates-io' ]
36- gll = { git = " https://github.com/rust-lang/gll" , rev = " f387326ea8fc48762c31f0dd5adc3d8d227328e4 " }
37- grammer = { git = " https://github.com/lykenware/grammer" , rev = " ed4fc4f9be9aa2c1a6c3245ba4e91684ddff5f2f " }
36+ gll = { git = " https://github.com/rust-lang/gll" , rev = " bc72820905eac498c1fb1cc644e931d63e7d07e3 " }
37+ grammer = { git = " https://github.com/lykenware/grammer" , rev = " eb47b51a9332c0e82d7c02d988e203d2a01f3654 " }
Original file line number Diff line number Diff line change @@ -17,7 +17,9 @@ fn main() {
1717 . filter ( |entry| entry. path ( ) . extension ( ) . map_or ( false , |ext| ext == "lyg" ) ) ;
1818
1919 // Start with the builtin rules for proc-macro grammars.
20- let mut grammar = gll:: proc_macro:: builtin ( ) ;
20+ let mut cx = gll:: proc_macro:: Context :: new ( ) ;
21+ let cx = & mut cx;
22+ let mut grammar = gll:: proc_macro:: builtin ( cx) ;
2123
2224 // Add in each grammar fragment to the grammar.
2325 for fragment in fragments {
@@ -27,14 +29,14 @@ fn main() {
2729 println ! ( "cargo:rerun-if-changed={}" , path. display( ) ) ;
2830
2931 let src = fs:: read_to_string ( & path) . unwrap ( ) ;
30- let fragment = gll:: parse_grammar ( src. parse ( ) . unwrap ( ) ) . unwrap ( ) ;
32+ let fragment = gll:: parse_grammar ( cx , src. parse ( ) . unwrap ( ) ) . unwrap ( ) ;
3133 grammar. extend ( fragment) ;
3234 }
3335
3436 // Generate a Rust parser from the combined grammar and write it out.
3537 fs:: write (
3638 & out_dir. join ( "parse.rs" ) ,
37- gll:: generate:: rust:: generate ( & grammar) . to_rustfmt_or_pretty_string ( ) ,
39+ gll:: generate:: rust:: generate ( cx , & grammar) . to_rustfmt_or_pretty_string ( ) ,
3840 )
3941 . unwrap ( ) ;
4042}
You can’t perform that action at this time.
0 commit comments