Comments (5)
This works:
a=(b=(c=(d=(e=f))))
So does this:
a=b=c=d=e=f
This doesn't work in the playground:
a=(b=c=d=e=f)
I suppose the question is whether the last example works in the grammar and if the parse tree is the same for all three examples.
If so, then this could be a job for @alexdalitz in the interpreter. If the final example is difficult to handle in the interpreter we could just call this known behaviour.
from grammar.
The first two examples work correctly in the java interpreter and the sandbox, but the third example fails in both. It gives this stack trace:
com.fasterxml.jackson.core.JsonGenerationException: Can not write a field name, expecting a value
at com.fasterxml.jackson.core.JsonGenerator._reportError(JsonGenerator.java:1961)
at com.fasterxml.jackson.core.json.WriterBasedJsonGenerator.writeFieldName(WriterBasedJsonGenerator.java:137)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:117)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:85)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:118)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:70)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:88)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:118)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:56)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeInternal(ModlValueJsonSerializer.java:45)
at uk.modl.parser.printers.ModlValueJsonSerializer.serializeStructure(ModlValueJsonSerializer.java:41)
at uk.modl.parser.printers.ModlObjectJsonSerializer.serialize(ModlObjectJsonSerializer.java:41)
at uk.modl.parser.printers.ModlObjectJsonSerializer.serialize(ModlObjectJsonSerializer.java:33)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:480)
at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:319)
at com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1396)
at com.fasterxml.jackson.databind.ObjectWriter._configAndWriteValue(ObjectWriter.java:1120)
at com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:993)
at uk.modl.parser.printers.JsonPrinter.printModl(JsonPrinter.java:59)
at uk.modl.parser.printers.JsonPrinter.printModl(JsonPrinter.java:34)
This is probably one for @alexdalitz (@elliottinvent can you reassign?)
from grammar.
@elliottinvent what is your expected output in this case?
from grammar.
a=(b=(c=(d=(e=f))))
and
a=b=c=d=e=f
Should ouput the same =>
{
"a": {
"b": {
"c": {
"d": {
"e": "f"
}
}
}
}
}
If the example below is difficult to handle in the interpreter then we could call it expected behaviour, but ideally it would output the same as the two other examples since it's effectively the same MODL structure, just expressed in a different way:
a=(b=c=d=e=f)
=>
{
"a": {
"b": {
"c": {
"d": {
"e": "f"
}
}
}
}
}
from grammar.
This is now working
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.