Coder Social home page Coder Social logo

tigerpython-parser's People

Contributors

microbit-matt-hillsdon avatar neilccbrown avatar tobias-kohn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

tigerpython-parser's Issues

High CPU then out of memory parsing invalid Python

Running

TPyParser.findAllErrors("{1:1=")

uses 100% of a core and then crashes the Chrome tab.

This was stripped down from something slightly more meaningful, but still invalid Python!

Running the same in NodeJS it's a bit clearer that it fails by running out of memory.

How to use setErrorMessage for french messages?

I have integrated TigerPython-Parser into a Python learning game.
I would like to be able to modify some error messages in French. But the setErrorMessage method does not work for the French language. As shown in the code below quoted from ErrorTranslator.scala

override def setMessage(code: ErrorCode.Value, msg: String): Boolean =
  _lang match {
    case "de" =>
      errormessages.GermanMessages.setMessage(code, msg)
      true
    case "en" =>
      errormessages.EnglishMessages.setMessage(code, msg)
      true
    case _ =>
      false
  }

}

Then how can I change these messages?

Thank you in advance,

Matthieu BRANTHÔME

Maximum call stack size error

Hi Tobias,

When testing my application in the classroom, one student encountered this problem:

PXL_20211004_094922605

I unfortunately don't have the Python code that caused the error, but if the error comes back, I will try to collect the Python code that causes this problem.

Any idea of what the problem is? Maybe a recurring call with no break cases?

Thks,

Matthieu

Improve common mistake : use the comma `,` instead of `.` for decimal point notation

One common mistake for the novices, at least in french speaking part of switzerland, is to use the comma instead of the . for floating point literals. This is because we say "nombre à virgule" to denote numbers with decimal positions. This generates errors really difficult to decrypt for the novices

from gturtle import *
makeTurtle()

size = 10
for _ in range(10):
    fd(size)
    rt(360 / 6)

    size *= 1,2

image

Python AST raises a JS error for comparators

Context: TigerPython is used in a Vue project. I am calling the parser to get the python AST of some small code portions.

When the parser finds a comparison, the returned expression object contains a left property that I can access. However, the comparators and ops properties cannot be accessed, because I get the following error : "Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them at Function.r"

Accept `_` in number litterals

The Python grammar allows underscores in the number litterals to increase readability. For instance, Python accepts litterals like 1_000_000 for 1 million. It would be great if the parser would accept that syntax.

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.