Skip to content

halcompile: fix parsing numbers#3847

Open
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
BsAtHome:fix_halcompile-number
Open

halcompile: fix parsing numbers#3847
BsAtHome wants to merge 1 commit intoLinuxCNC:masterfrom
BsAtHome:fix_halcompile-number

Conversation

@BsAtHome
Copy link
Contributor

@BsAtHome BsAtHome commented Mar 5, 2026

This PR addresses problem in halcompile generated code that used floating point values as initializers for integer variables.
The problem was in the parsing of floating point numbers where the exponent was optional, even when no period was found in the mantissa. That meant that any decimal integer would become a float.

The changes assure proper differentiation between integer values and floats:

  • 1 = int
  • 1. = float
  • 1e1 = float

Additionally:

  • it is now allowed to use the binary and octal bases with prefixes 0b and 0o like python does it
  • some extra newlines in the output were removed where they were not necessary
  • extra module parameters of type 'dummy' now generate a man-page entry that is no longer numeric: modparm=_N_ is now modparm=_value_[,_value_...]

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