Giter Club home page Giter Club logo

Comments (3)

danhcole avatar danhcole commented on August 24, 2024

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 ints. 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.

danhcole avatar danhcole commented on August 24, 2024

Now works for int, float, char, string and id. Still needs other exprs

from stitch.

danhcole avatar danhcole commented on August 24, 2024

Works for all other exprs. All tests up to and including ops1.stch work.

from stitch.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.