Giter Club home page Giter Club logo

traversal-lang's Introduction

I'm a final-year student at Imperial College London studying Computing with an integrated Masters.

My research interests lie primarily in programming languages. Currently, I'm most interested in static program analysis and functional programming.

noot noot

traversal-lang's People

Contributors

roccojiang avatar

Stargazers

 avatar

traversal-lang's Issues

Consider comparison operator rules

As of commit 4239769, certain comparison operator rules may cause some confusing grammar. These rules should be considered and potentially modified in the future.

Due to booleans no longer being treated as integers:

  • 1 = 1 = 1 evaluates to false as this becomes true = 1
  • However booleans can also no longer be compared using <=, <, >=, or > which makes sense

Due to strings being unable to be compared using <=, <, >=, or >:

  • "hello" <= "hello" throws an error even though technically it could be seen as true?

'Hacky' approach in parsing input?

Because the parser can only parse one line of text, main.py takes text line-by-line from test.txt to 'feed' into the parser. This isn't necessarily an issue but I'll leave this here as a reminder in case I want to come back to this in the future.

Errors due to trailing whitespace

Due to the parsing grammar of Traversal, certain whitespace characters (sometimes spaces, especially tabs) cause errors when placed at the end of lines. This causes a lot of confusion as the error messages aren't very indicative of the actual error.

Add custom comparison operator rules

As of commit 14689be, comparison operators are completely handled by the Python interpreter. Custom rules should be added to enforce:

  1. Nicer error messages
  2. Type rules of the EPQ language (e.g. unlike Python, booleans should not be explicitly considered as integers)

$end error thrown due to extra newline characters

If there is one (and only one) newline at the end of test.txt, no errors are thrown. However, if there is a newline anywhere else or more than one at the end of the file, the ValueError: Ran into a $end token where it wasn't expected error is thrown.

Parser can technically only take in single-line input

Currently the parser takes input from test.txt line-by-line, as written in main.py, because the parser currently cannot take in multi-line input and can only deal with one line. This 'hacky' approach will have to be eventually rewritten to support more complex code.

A weird effect of this implementation is that a newline must be present at the end of test.txt, as every line has to be terminated with a \n character.

Remove old code for COMMENT tokens

Comment tokens have been replaced by using regex to ignore all text following //, thus all old code referring to COMMENT tokens should be removed

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.