Giter VIP home page Giter VIP logo

scilint's Issues

repeated unary operators

I read somewhere on the internet that ~expr was the same as ~~~~expr, which is not, it is a repeated application of the ~ operator, and it happens that applying a boolean negation an odd (and > 1) number of times is useless since it can be rewritten as a single one. Applying ~ twice is ok, it is a cast to bool (~~3 is T), but applying it four or more times is also useless.

Scilint should warn about a number of nested applications of ~ strictly superior to 2.
Scilint should also probably warn about a number of applications of - strictly superior to 1.

primitive factorial does not work on a value of type real

lycee()
exp(10)/factorielle(10)

String "box-2", line 1, characters 8-23:
String "factorielle.sci", line 16, characters 4-16:
Error: primitive factorial does not work on a value of type real
Hint: you can try redefining %s_factorial
⇊Insert a new box after this one.

comas inside a shell call

I found a probably erroneous piece of code:
clear X,Y ;
which is equivalent to:
clear X
Y
and not at all what the programmer probably meant:
clear ('X','Y')

Scilint should warn about this however there is no simple way from the AST.
Three options seem possible to me:

  • warn in a more general way about any sequence of two instructions located on the same line, this should detect this one but may be too restrictive
  • detect this directly in the parser (probably easier inside my upcoming experimental parser)
  • implement some sort of simple textual matching on the source

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.