nmushegian / jams Goto Github PK
View Code? Open in Web Editor NEWactually minimal JSON alternative
actually minimal JSON alternative
JSON libraries manually handling escapes will check the character after a '' to make sure it is a valid escape, eg '\' '\r', '\n', '\t' '\b', or a valid unicode escape. This kind of escape handling passes the current JAMS test suite. However, you can also pass the tests by simply blindly including anything following a '\' inside a quote string, without checking for a valid escape. Opening issue to request clarification on how best to handle in JAMS.
i.e. similar to casetest, but without having to escape a bunch of stuff to make it work
We certainly want empty strings be part of the format.
{ ok !@#$....}
{ bad st[ring }
{ ok " ... " }
, include all variations of all escapes and whitespace\
are defined to pass through, then you can't have an invalid string? at worst you terminate the string early with "
?Jams.js is not currently usable by default without either changing the import to point to the actual file jams.js
/ changing the filename of jams.js
to index.js
To keep our sanity this time around let's try to stick with file-based tests as much as possible
For that we need a fail
folder to correspond to pass
folder where we put files that are supposed to fail to parse
It is important to make sure they are failing due to JAMS parse error and not some other reason, and that 'failing failures' are not squelched
Similar to #4
If a string uses unicode escape sequences, that sequence should be a well-formed code point (not necessarily defined in unicode table just valid bytes)
Duh
let’s also have a better interface than toJSON maybe put optional args into named opts
Lines 3 to 14 in 78e1459
JSON spec does not say what to do if there are multiple keys and different parsers do different things.
In JAMS, duplicate keys are defined to be invalid JAMS files, they should not parse. Note this technically changes which kind of language/grammar JAMS is (not LL1 anymore I think) but it doesn’t matter
This will let us drop ebnf and also have comprehensible error messages
We might be able to dump the generated parser (function built at runtime) out of ebnf library somehow for guidance
"same as JSON, but allow newlines" (also tabs?)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.