mtborg / d7050e Goto Github PK
View Code? Open in Web Editor NEWRust compiler for course D7050E
Rust compiler for course D7050E
Seems to be some problem with parsing negative signs in expressions.
foo(n-1)
causes some problems to fail, complaining aboout unrecognized token -1. Workaround is to put spaces around the '-' sign. Problem goes away when removing the possibility for numbers to parsed with a leading '-' sign.
The type checker seems to evaluate return statements in function arguments as valid return statements, i.e.
foo(return 1);
gets evaluated as
return 1;
let a = b;
most likely does not work.
At the moment this is not possible as lalrpop can't seem to handle raw string literals, i.e.
use crate::r#type::Type
fails.
Test more than just "is_ok()", e.g. test return values.
Should help a lot with debugging
fn foo() -> i32{ let a = 2;
should currently be possible but should not be.
Expression
true + true
should not be valid.
At the moment the boolean parser will mark
a == b == c
(which is not valid according to the rust compiler) as valid.
At the moment numbers are not allowed to be negative. This is easily fixed by allowing for a minus sign in the number-regex, although this would allow for expressions such as
let a = 2 + -2;
which does not look very nice.
The regex results in a false negative for the case when the identifier starts when an underscore and then a number (which should be allowed). Have not tested though.
Should give code location hints
Example:
foo(bar())
Probably wont work (haven't tested)
Some tests fail because what they test hasn't been implemented yet.
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.