Add rerun_except crate, and small example code
* rerun_except will ensure a build doesn't rerun if a *.not file is modified, which it would otherwise do * Add examples/expr.not with some basic assignment statements and function calls Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ edition = "2018"
|
||||
cfgrammar = "0.9"
|
||||
lrpar = "0.9"
|
||||
lrlex = "0.9"
|
||||
rerun_except = "0.1.2"
|
||||
|
||||
[dependencies]
|
||||
cfgrammar = "0.9"
|
||||
|
||||
5
build.rs
5
build.rs
@@ -1,8 +1,13 @@
|
||||
use cfgrammar::yacc::YaccKind;
|
||||
use lrlex::LexerBuilder;
|
||||
use lrpar::CTParserBuilder;
|
||||
use rerun_except::rerun_except;
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// Skip rerunning if it's just *.not files that have changed
|
||||
rerun_except(&["*.not"]).unwrap();
|
||||
|
||||
// Build parser + lexer
|
||||
let mut parser_builder = CTParserBuilder::new()
|
||||
.yacckind(YaccKind::Grmtools)
|
||||
.error_on_conflicts(false);
|
||||
|
||||
5
examples/expr.not
Normal file
5
examples/expr.not
Normal file
@@ -0,0 +1,5 @@
|
||||
kilo = pow(2, 10)
|
||||
mega = pow(2, 20)
|
||||
giga = pow(2, 30)
|
||||
tera = pow(2, 40)
|
||||
peta = pow(2, 50)
|
||||
Reference in New Issue
Block a user