Comments (3)
So, right now print
is set up to be 'psudo-polymorphic'. When the semantic analyzer checks a function call, if the call is named 'print', it handles it specially. If the type is an int
, float
, char
or string
, it passes it, otherwise it throws an exception.
In the generator, when it prints the call, if the call is to print
, it manually inserts the correct printf
statement.
Right now, this only works with int
s. If you pull the current code, and run the test suite, the first four or five tests pass. When the suite gets to the 'hello world' test, it fails. I need to go in and add type-checking to the generator, to correctly format the printf
statements, which shouldn't be too hard to do. Something similar can be done for other built-in's.
from stitch.
Now works for int
, float
, char
, string
and id
. Still needs other expr
s
from stitch.
Works for all other exprs. All tests up to and including ops1.stch
work.
from stitch.
Related Issues (20)
- char type HOT 1
- Assignment HOT 1
- Check_If is only valid for int expressions? HOT 1
- check_call throwing wrong error HOT 1
- block was reversing statements
- Arrays and size
- Testing HOT 1
- Stitch loop variable passing HOT 1
- Nested Stitch
- Stitch scoping HOT 1
- Variable decls inside loops HOT 2
- Array Passing HOT 1
- return type of functions HOT 1
- Binop expressions in parenthesis are not evaluated first HOT 1
- Either add cut(int) or take out of LRM HOT 1
- need to add back access, structs and arrays
- remove code diffing from test suite HOT 1
- stch_headers HOT 2
- redo assign / assign2 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stitch.