Closed sweihub closed 1 year ago
Comment support is a great idea, and should not be too difficult. My resources to work on this crate are limited though, so I would be happy about a pull request.
One would add this somewhere in the tokenizer, where, whenever a //
is
encountered, the tokenizer just skips until after the next newline
character.
On Fri, 18 Aug 2023, 4.46 Alex Wei, @.***> wrote:
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, ...)
— Reply to this email directly, view it on GitHub https://github.com/ISibboI/evalexpr/issues/143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AASATXVC6NLFUD3BMOFTOUTXV3CNXANCNFSM6AAAAAA3U3QDSI . You are receiving this because you are subscribed to this thread.Message ID: @.***>
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 https://github.com/ISibboI/evalexpr/pull/148 proposed.
I checked that Mr. @ISibboI has merged and updated the docs, thanks for quick response! Closed!
Hi Dear Author
Would you add C like comment to your mini formula language? It will be useful for long expressions, such as ...