Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Negative real literals not implemented in the parser #354

Closed
PhucVH888 opened this issue Mar 22, 2016 · 6 comments
Closed

Negative real literals not implemented in the parser #354

PhucVH888 opened this issue Mar 22, 2016 · 6 comments
Assignees

Comments

@PhucVH888
Copy link
Contributor

When I try to represent a vector with both negative and positive real numbers.
The result is that I cannot initialise the arrays with negative real array.

class Main 
  def main() : void 
    let tem = [-1.0] in
    ()

Or even trying with negative real number itself

class Main 
  def main() : void 
    let tem = -1.0 in
    ()

And here is the error message:

unexpected "."
expecting digit, operator, "," or "]"
@PhucVH888 PhucVH888 added the bug label Mar 22, 2016
@EliasC
Copy link
Contributor

EliasC commented Mar 22, 2016

I just want to point out that the arrays have nothing to do with the problem. It is the parser that cannot handle negative reals.

@TobiasWrigstad
Copy link
Contributor

How hard is this to address? Is the problem the dot in the real?

@PhucVH888
Copy link
Contributor Author

Probably. But it works this way.

class Main 
  def main() : void 
    let tem = 0-1.0 in
    ()

@supercooldave
Copy link

Someone should fix this.

@TobiasWrigstad
Copy link
Contributor

@PhucVH888
Of course, but that's not very nice in the long run. We need a permanent fix to this that allows programmers to use negative literals.

@supercooldave
+1

@TobiasWrigstad TobiasWrigstad changed the title Can not represent negative real number Negative real literals not implemented in the parser Apr 7, 2016
@EliasC EliasC self-assigned this Apr 11, 2016
PhucVH888 added a commit that referenced this issue Apr 12, 2016
Fix #354, Added support for negating expressions
@EliasC
Copy link
Contributor

EliasC commented Apr 12, 2016

Fixed as of 6791bfe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants