Skip to content

Fix octal integer constant (0o...) parsing in row-filter calculator#141

Merged
c181gordon merged 1 commit into
heasarc:developfrom
cruzzil:fix_octal
Jun 21, 2026
Merged

Fix octal integer constant (0o...) parsing in row-filter calculator#141
c181gordon merged 1 commit into
heasarc:developfrom
cruzzil:fix_octal

Conversation

@cruzzil

@cruzzil cruzzil commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

The flex rule for octal integer constants in eval.l had a typo:

octconst        (0o]+)

The intended character class "[01234567]" was lost, so the pattern could
never match a real octal literal. As a result an expression such as
"(DIAMETER > 0o11610)" was tokenised as the integer 0 followed by the
octal bit string o11610, producing a syntax error (status 431), even
though 0x.. (hex) and 0b.. (binary) integer constants worked. Corrected
to:

octconst        (0o[01234567]+)

Regenerated eval_l.c with flex 2.6.4 (a pure DFA-table change).

    The flex rule for octal integer constants in eval.l had a typo:

        octconst        (0o]+)

    The intended character class "[01234567]" was lost, so the pattern could
    never match a real octal literal. As a result an expression such as
    "(DIAMETER > 0o11610)" was tokenised as the integer 0 followed by the
    octal bit string o11610, producing a syntax error (status 431), even
    though 0x.. (hex) and 0b.. (binary) integer constants worked. Corrected
    to:

        octconst        (0o[01234567]+)

    Regenerated eval_l.c with flex 2.6.4 (a pure DFA-table change).

@esabol esabol left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Surprising that it's gone unnoticed for 7 years.

@c181gordon c181gordon merged commit 378db89 into heasarc:develop Jun 21, 2026
3 checks passed
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.

3 participants