Comments (3)
I agree with you here and your expectation.
This doesn't work in the playground at the moment, if the parse tree in the grammar is correct then this will be an interpreter issue for @alexdalitz to take a look at.
from grammar.
The playground produces an error when parsing x=[1;2:3:4]
:
line 1:6 extraneous input ':' expecting {NULL, TRUE, FALSE, NEWLINE, SC, LBRAC, LSBRAC, RSBRAC, NUMBER, STRING, QUOTED, '{'}
While the Java interpreter produces this, which is incorrect:
{
"x" : [ 1, 2, 3, 4 ]
}
The parse tree interprets the input correctly as a 2-element array of '1' and an nb_array of 2:3:4, so the result should be something like:
{
"x" : [ 1, [2;3;4] ]
}
See issue#7 for more information about mixed arrays and nb_arrays. (@elliottinvent please reassign to @alexdalitz )
from grammar.
Added this to tests :
{"input": "x=[1;2:3:4]\na=%x>1>1", "minimised_modl": "x=[1;2:3:4]\na=%x>1>1", "expected_output": "{\"x\": [1,[2,3,4]], \"a\":3}"},
from grammar.
Related Issues (20)
- Possibly ambiguous expressions HOT 4
- Double negatives HOT 3
- Observation HOT 2
- Operator Precedence HOT 5
- Stray tokens files HOT 2
- Identifier names HOT 29
- Only strings in conditional tests HOT 1
- Upcase method not invoked HOT 5
- Non-UTF-8 Input Characters in tests HOT 2
- Deep object referencing in conditionals HOT 3
- Array problem HOT 6
- Standard Error Messages for Failures HOT 5
- New Built-in Method Suggestions
- Short path for loading modules HOT 1
- Graves and References Handling HOT 7
- Grammar problem - escaped grave HOT 7
- Grammar Problem - double quotes HOT 4
- File update needed for new grammar HOT 1
- Interpreter escape for % HOT 2
- String Unicode Fragment Issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grammar.