Skip to content

lexer: FIX-CODEPAGE is not a known built-in, so every use is a false undefined-symbol #156

Description

@evanbrobertson

ABL's FIX-CODEPAGE is not in the built-in registry, so a reference to it is reported as an undefined symbol at error severity.

Repro

DEFINE VARIABLE lcConfig AS LONGCHAR NO-UNDO.
FIX-CODEPAGE(lcConfig) = "UTF-8".

error[LINT0001]: undefined symbol FIX-CODEPAGE``, spanned on the statement.

Not necessarily a one-line registry addition

FIX-CODEPAGE is settable — it appears on the left of an assignment, as above, which is how it is normally used. So the fix has two parts, and only the first is mechanical:

  1. Register the name so it stops being undefined.
  2. Model the assignment-target form, so FIX-CODEPAGE(x) = "UTF-8" credits a write to x (that is what the statement does — it fixes the codepage of the LONGCHAR) rather than a read, or nothing.

Getting part 1 alone would clear the false undefined-symbol and could leave the count-gated rules with a wrong access record for x. Worth checking whether other settable pseudo-functions have the same gap while this is open — the handle/attribute family is the place to look.

Payoff

Clears a false error on a correct, common statement. Small and self-contained; the second half is the part that needs a decision rather than a lookup.

Pre-existing and independent of cross-file resolution: identical output before and after PR #153.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions