Comments (8)
I am new to this , so can you help a little and tell me what this function should do ? Thx
from snot_lang.
Oh, wow! A contributor!
Well, a pretty-printer for some hierarchical datastructure / markup languages is a print function that sets up nice indentation and spacing so that the markup will be easy to read.
For example:
{"first":[1,2,{"other":[7,8,0],"ahah":56.6}],"second":{"secondsfirst":4.5}}
is valid SNOT (and therefore valid JSON).
But:
{
"first":[
1, 2, {
"other":[ 7, 8, 0],
"ahah":56.6
}
],
"second":{
"secondsfirst":4.5
}
}
is significantly easier to read.
from snot_lang.
Basically the function needs either a stack or recursion and descends into the datastructure, keeping track of how many levels in it is, and applies some rules about indentation and formatting.
from snot_lang.
In what language should I implement this function ?
from snot_lang.
It should go in param_storage.h
(in lexyacc/src
) , be written in standard C++98 , and complement/ work well with the existing code. It should either be a member method or static method of gsparams::DictList
.
Thanks!
from snot_lang.
Except for potentially including a new standard header (which I hope can be avoided), the new function should be totally self-contained. I mean that you should not need to alter any other part of the code, just add the function to the DictList class.
from snot_lang.
Is there a document explaining the parts of code already written? I have a problem understanding thr DictList class functionality.
from snot_lang.
There isn't any proper doxygen API or anything, but there are examples at https://github.com/bryan-lunt/SNOT_lang/tree/master/lexyacc/examples
from snot_lang.
Related Issues (6)
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 snot_lang.