question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing token, expecting ','

See original GitHub issue

Hi there, I have a simple function for testing a rule taking 3 parameters Rule('a60f99fa-21ee-4dfa-b8c1-80ffaa3a83de', 10, 20)

This causes an error Missing token, expecting ',', if I change the first number to a string by enclosing them in ‘’: Rule('a60f99fa-21ee-4dfa-b8c1-80ffaa3a83de', '10', 20) then the error goes away.

Why is this error appearing, it looks like the second integer after an integer messes things up. Eg this causes the same error Test(12,33,44)

Update If I change it to Rule('a60f99fa-21ee-4dfa-b8c1-80ffaa3a83de', 10,0, 20,0) it works. But then the parameters are not integers anymore but decimals.

It seems that the comma after a number (for a second parameter) makes the parser think it’s dealing with a decimal. Hence the space makes the parser think it’s missing a comma.

Shouldn’t the parser take a dot for decimals?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
bijingtoncommented, Aug 24, 2017

@bluewalk thanks that is exactly the response I was hoping for 😃. I have a fix and will be performing a release very shortly.

0reactions
bluewalkcommented, Aug 22, 2017

@bijington Yes, I am expecting (as a programmer) to use 10.x instead of 10,x as the comma is used to separate parameters for a function in the expression.

So basically I would be expecting that the following works: ExpressionFunctionA('somestring', 10, 20.5)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: There was a missing Token - Jira
I am receiving multiple complaints from users getting similar errors when they try to attach a document, create a task or transition a...
Read more >
syntax error, unexpected token \"=\", expecting \"]\"
I'm trying to send a mail through Postman but it sends a 500 error response. Here's the code in my controller: Mail::to($user ...
Read more >
[Bug]: Missing Token Symbol when Sending on a Payable ...
missing -token-symbol.mp4. I am expecting to see the token symbol in the same way as we do for Sends or Transfers. See example:....
Read more >
SyntaxError: Unexpected token - JavaScript - MDN Web Docs
The JavaScript exceptions "unexpected token" occur when a specific language construct was expected, but something else was provided.
Read more >
SyntaxError: Unexpected token in JavaScript
The "SyntaxError: Unexpected token" error in JavaScript is a common syntax error that occurs when the JavaScript interpreter encounters a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found