c4deszes / ldfparser

LIN Description File parser written in Python
https://c4deszes.github.io/ldfparser/
MIT License
64 stars 26 forks source link

support upper and lower case E for scientific notiation #134

Closed matt-oliver-canada closed 8 months ago

matt-oliver-canada commented 8 months ago

ldfparser should support both upper and lower case 'E' for scientific/engineering notation values.

It currently only supports lower case e

https://github.com/c4deszes/ldfparser/blob/2ec017f2eba4ed01a62a23a5f914e582b5bdd0fa/ldfparser/grammars/ldf.lark#L125

I tested with this solution in my local venv and it was able to parse the file containing an upper case E. C_FLOAT: ("-"? INT ("." INT)?) (("e" | "E")("+" | "-")? INT)?

I have come across a file with an encoding value like this. From what I understand both e and E are valid.

my_lin_encoding {
  physical_value, 0, 255, 1.2345E-3, 0, "V" ;
}