Skip to content

Normalize CANdo Dash Placeholders To YAML Null - #552

Open
coderask wants to merge 1 commit into
remove-thousands-separatorsfrom
normalize-null-fields
Open

Normalize CANdo Dash Placeholders To YAML Null#552
coderask wants to merge 1 commit into
remove-thousands-separatorsfrom
normalize-null-fields

Conversation

@coderask

Copy link
Copy Markdown
Contributor

Summary

Replace "-" (quoted dash) placeholders with YAML null (~) for boolean fields where scaled min, scaled max, and map equation are not applicable.

Changes

In Autogen/CAN/Doc/GRCAN.CANdo, six fields used "-" as a placeholder meaning "not applicable":

  • Inv Config / Motor direction: scaled min, scaled max, map equation
  • Inv Cmd / Drive enable: scaled min, scaled max, map equation

Both are boolean fields (data type: b) where scaled range and map equation have no meaning. YAML null (~) is the idiomatic way to express "no value" rather than a quoted dash string.

Parser Compatibility

The Perl parsers (DBCparser.pl) already handle ~ correctly:

  • parse_eq: the string "~" does not match $HYPHEN or any equation pattern, so it falls through to the default return (1, 0) -- identical behavior to "-".
  • _to_number: "~" does not match /^-?\d/ so it returns 0 -- identical behavior.

DBC output was verified identical before and after the change across all three generated files (Primary, Data, Charger).

Convention

Optional fields should use ~ (YAML null) when not applicable, and should be filled out whenever the information is known.

@coderask
coderask requested a review from dchansen06 as a code owner August 29, 2026 17:17
@coderask
coderask force-pushed the normalize-null-fields branch from d85eb22 to a454d03 Compare August 29, 2026 17:36
@coderask
coderask changed the base branch from main to remove-thousands-separators August 29, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant