Skip to content

Commit

Permalink
Support both upper and lower case E in scientific notation (#135)
Browse files Browse the repository at this point in the history
* Add support for upper case in values
  • Loading branch information
matt-oliver-canada authored Feb 25, 2024
1 parent 2ec017f commit 8a38dc2
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.24.0] - 2024-02-22

### Changed

- scientific/engineeering notation values can now have upper case E

## [0.23.0] - 2024-02-05

### Changed
Expand Down
2 changes: 1 addition & 1 deletion ldfparser/grammars/ldf.lark
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ signal_representations: "Signal_representation" "{" (signal_representation_node+
signal_representation_node: ldf_identifier ":" ldf_identifier ("," ldf_identifier)* ";"

C_INT: ("0x"HEXDIGIT+) | ("-"? INT)
C_FLOAT: ("-"? INT ("." INT)?) ("e" ("+" | "-")? INT)?
C_FLOAT: ("-"? INT ("." INT)?) (("e" | "E")("+" | "-")? INT)?
LIN_VERSION: INT "." INT
ISO_VERSION: "ISO17987" ":" INT
J2602_VERSION: "J2602" "_" INT "_" INT "." INT
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
version = 0.23.0
version = 0.24.0
7 changes: 7 additions & 0 deletions tests/ldf/lin_encoders.ldf
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,13 @@ Signal_encoding_types {
BCDEncoding {
bcd_value;
}
ScientificEncoding {
physical_value, 0, 255, 5.6785558246e-04, 0, "Ohm";
physical_value, 0, 255, 7.654E-02, 0, "Ohm";
physical_value, 0, 1024, 3.778e02, 0, "Ohm";
physical_value, 0, 1024, 1.222E09, 0, "Ohm";
physical_value, 0, 65535, 3.5E+02, 5, "Ohm";
}
}

Signal_representation {
Expand Down

0 comments on commit 8a38dc2

Please sign in to comment.