originalsouth / pallache

A small and simple header only math parser library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Float values starting with decimal point leads to unknown token error

jaysonpaulose opened this issue · comments

Defining a float without the leading zero in the config file leads to an error.

E.g. the line

v=.8

raises the error

pallache: unknown token "."

I think I did that intentionally, I never liked the .8 notation; I always use 0.8.
Otherwise, I'll have to patch pallache.h:208 (which is easy).
With a trivial work around for this issue, give me a good reason why I should adapt to the ".8" notation, meanwhile I'll consider it :)

Since the ".8" notation is a valid notation for floating-point literals in C++ (see http://en.cppreference.com/w/cpp/language/floating_literal , if I knew how to search the C++ standard I would have referenced that), a reasonable user would expect it to also be valid for the options parser. If I can do it in my code but not in my configuration file, then the options parser becomes cumbersome to use.

Fixed.
Thanks for the commit.