catb0t / cat-language

Automatically exported from code.google.com/p/cat-language
Other
0 stars 0 forks source link

Can not parse floating literal in non-english locale #36

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When locale defines decimal separator as comma, not dot, the grammar is not in 
sound with parser: grammar tells to read dot (and interpreter does it), but 
then parser can not recognize floating point literal as it expects comma 
instead of dot.

Can be (and is) solved by parsing in this vay:

value = double.Parse(ToString(), 
System.Globalization.CultureInfo.InvariantCulture.NumberFormat);

Thanks!

Original issue reported on code.google.com by dlu...@gmail.com on 23 Jan 2012 at 9:34