statement => expression* | return ; // initially only expressions and a final return is supported (not sure how to represent it)
return => "return" low_bin ";"? ;
expression => assignment | reassignment;
assignment => ("const" | "mut") IDENTIFIER ( "=" ) low_bin ";"? ;
reassignment => IDENTIFIER ( "=" | "/=" | "-=" | "+=" | "*=" | "&=" | "^=" | "|=" ) low_bin ";"? ;
low_bin => high_bin ( ( "-" | "+") high_bin )* ;
high_bin => TERMINAL ( ( "/" | "*" | "%" ) TERMINAL )* ;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn high_bin(&mut self) -> Option<Box<Expr<'a>>> { | |
let left = self.term()?; | |
let bin = self | |
.lexer | |
.collect_of_if(&[Token::Div, Token::Mul, Token::Mod]); | |
if let Some(x) = bin { | |
// TODO:: Error if expr is none | |
let right = self.term()?; | |
return some_expr!(BinOp, left, x.token, right); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
au FileType rust set compiler=rs |
I have two units of code (featureA.c, featureA.h) (featureB.c, featureB.h). featureB
has an include to featureA.h
because it uses a function there, when i do this, everything works out.
gcc -Wall -O0 -std=c11 -g -o test.exe test.o featureA.o featureB.o -lpthread
However, now I want to distribute my libraries. When I attempt to make an example project with.
gcc -Wall -O0 -std=c11 -g -o target/example.exe example/main.c lib/libfeatureA.a lib/libfeatureB.a -lpthread