sklose/NCalc2

Comment support

Closed this issue · 1 comments

Hi, I need a comment support (like in C# /**/ and //), is anybody tried to add support directly in NCalc? Of course I can prepare the data before passing to NCalc, but I believe antlr will be faster and more suitable for it.

Something like this will work if you just want to throw them away.

SINGLE_LINE_COMMENT:
	'//' .*? ('\r'? '\n' | '\r') -> channel(HIDDEN);

MULTI_LINE_COMMENT: '/*' .*? '*/' -> channel(HIDDEN);