ISibboI/evalexpr

Feature Request: Add C like comment support

sweihub opened this issue · 4 comments

Hi Dear Author

Would you add C like comment to your mini formula language? It will be useful for long expressions, such as ...

// Symbols
s1 = "IC2309";
s2 = "IH2312";
s3 = "IF2309"
s4 = "IC2312";

// Inputs
my_ask = future(s1, "ask");
my_bid = future(s2, "bid");
my_mid = (my_ask + my_bid) / 2;
my_last = future(s3, "price");
my_ask *= 1.0001;
my_bid += 0.0005; 
my_bid2 = future(s4, "bid") * 1.0002;

// Ouput
M1 = (my_ask, my_bid, my_mid, my_last);         
M2 = (my_ask, my_bid2, ...)

Oh, cool, I will do it, the idea is adding C like comment, /* inline comment */ and // single line comment. I am so glad that you are agree with that, I will make a PR later, thanks!

/* inline comment */
s1 = "IC2309";
s2 = "IH2312";
s3 = "IF2309"
s4 = "IC2312";

// Inputs
my_ask = future(s1, "ask");
my_bid = future(s2, "bid");
my_mid = (my_ask + my_bid) / 2;
my_last = future(s3, "price");
my_ask *= 1.0001;
my_bid += 0.0005; 
my_bid2 = future(s4, "bid") * 1.0002;

// Ouput
M1 = (my_ask, my_bid, my_mid, my_last);         
M2 = (my_ask, my_bid2, ...)

PR #148 proposed.

I checked that Mr. @ISibboI has merged and updated the docs, thanks for quick response!
Closed!