ncharlton02 / aurora Goto Github PK
View Code? Open in Web Editor NEWA lua interpreter written in rust
License: MIT License
A lua interpreter written in rust
License: MIT License
The lua function assert has been implemented for some time now so we should probably use the over the test variables from the toml tests.
Currently ExprType is defined as https://github.com/DevOrc/aurora/blob/f0146452fb8ce9772162928e855c7b1841ff716a/src/lib.rs#L99-L102
It should probably refactored into the following:
#[derive(Debug, PartialEq, Clone)]
enum ExprType{
Data(LuaData), SingleValue
}
Line counting has lots of issues
Travis is failing because cargo test doesn't compile - it broken in the most recent changes regarding the parser
When comparing strings in if statements, the expression parser parses ==
as a number binary operator so the interpreter tries to parse the strings into numbers and fails.
This will allow aurora to have "for in" loops
If two files require the same module, it will be loaded and ran twice...
Travis is currently failing for some reason:
panicked at 'Unexpected token type: Identifier("sub")', src/expr.rs:72:18
Lua Source:
add = 5 + 5
sub = 5 - 5
mult = 5 * 5
div = 5 / 5
print("5 + 5 = " .. add)
print("5 - 5 = " .. sub)
print("5 * 5 = " .. mult)
print("5 / 5 = " .. div)
Rust Source
fn scan_stmt(&mut self) -> Stmt{
let token = self.next_token();
if token == None{
return Stmt {stmt_type: StmtType::EOF};
}
let token = token.unwrap();
if self.expr_type == ExprType::SingleValue{
return Stmt{stmt_type: StmtType::Value(token)};
}
match token{
Token::NumberLiteral(_) => self.scan_num_expr(token),
Token::StringLiteral(_) => self.scan_string_expr(token),
_ => panic!("Unexpected token type: {:?}", token) // <- Panics here
}
}
We should have multiple binary versions to run
Preferably the display impl should use the to_string method to keep it consistent
We currently only support whole numbers
We started coverage in ef3e06f
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.