Tested it live and it looks good.
I would recommend that you use a less transparent look.
The format is nice, but it would be useful if you add the ',' and display empty arrays in one line.
For configs, it would be nice if arrays would be split into multiples lines too.
And I would recommend to make a config-browser out of it
Thanx.
I take note of your wishes, but more likely I am completely rewrite the code. This will not be very fast.
Do you want to add a parser for code too? So parsing at ';', '{' and '}'? Would be nice.
And if the preprocessor code exists, you could parse at the #line x.
It would be extremely interesting to look to its implementation at sqf, though just as interesting to write it himself. Regarding the preprocessor. We can give input preprocessor does not file, a string? I'm not sure what you mean.
Finally: Will you make your parser public so others can use it?
Sure. (It's friendly than "Yes of course"?
) That's all for fun. MIT license.
PS.
I'm not quite sure what parser is being discussed. The parser takes the input that a plain-text, and gives to output tree (or graph) structure. I do not use any of parsers in the classic sense. If you are interested in bypassing the config tree, look at this attach.
-------------
@ kju
Oh, happiness, the topic is open again. Relax guys. All you need to good tree-traversal (like a config or array) is:
walk = function (node) (
if (node is subtree) (
node call walk
) else (
print node
)
)
Every IT-guy knows about it. But they do not. So compare the code doesn't make sense.
Excuse me, if I misread the situation.
PS.
If I'm like a bull in a china shop, tell me.
I still learn to understand and speak.
@ kju
Sorry, seems, I didn't get what you meant. If someone needs help, I'm happy to help. My mail DenVdmj@gmail.com
==========================================
Ok, I corrected the display of the commas in arrays. Arrays in config is now displayed with an indent. it looks like this:
Slightly increased size of the window, reduced transparency. The color of the window can be customized. Create a file:
X: \ Documents and Settings \ User \ Docs \ ArmA Other Profiles \ ArmaNick \ scripts \ SQFCalculator \ settings
with follows lines:
_titleBG = [.1, .1, .12, .8]; // title ground color
_groundBG = [.1, .1, .12, .8]; // ground color
_myHistory = [ // extend history
"units player"
];
I tried to add hot keys, but was faced with the fact that it is impossible to programmatically change the current tab. While switching windows works:
alt +1 - text input box
alt +2 - Result
alt +3 - Copy
alt +4 - History
alt +5 - Demo
alt +6 - Help
alt + left - switch to left window
alt + right - switch to right window
But without changing buttons of tabs all these can not be used.
I will think how to overcome it.
Added an example of the use of demo-mode. You can do simple demo for the your libraries, functions, or just ideas.