Skip to content

vms-c211: SET SYMBOL /ALL /GENERAL /VERB scope-domain selectors (+ /GLOBAL /LOCAL IVQUAL) - #487

Merged
baron-3dl merged 1 commit into
mainfrom
vms-c211-set-symbol-quals
Aug 13, 2026
Merged

baron-3dl merged 1 commit into
mainfrom
vms-c211-set-symbol-quals

Conversation

@baron-3dl

Copy link
Copy Markdown
Contributor

Summary

Implements the remaining SET SYMBOL qualifiers deferred from vms-2af (#441, which added /SCOPE + per-@-level local symbol frames). Semantics are taken from the public OpenVMS DCL Dictionary (VSI OpenVMS DCL Dictionary N–Z, SET SYMBOL), which defines exactly four command qualifiers:

Qualifier Effect
/SCOPE=(keyword,…) the scope change itself ([NO]LOCAL, [NO]GLOBAL) — already done by vms-2af
/ALL (default) the /SCOPE change applies to both first-token (verb) translation and general symbol substitution
/GENERAL applies to all symbols except the first token on a line
/VERB applies only to translation of the first token on a line as a symbol

/ALL, /GENERAL, /VERB are mutually exclusive.

What changed

  • Per-domain scope state. Each command-level frame now tracks the /SCOPE hide-flags separately for the general and verb translation domains (dcl_symbol.c). dcl_sym_get_ex(name, domain) consults the right domain; the verb-position lookup in dcl_exec.c uses the VERB domain, every other lookup the GENERAL domain. So /VERB and /GENERAL have a real, observable effect: verb translation can be hidden while general 'sym' substitution still works, and vice-versa. /ALL (default) sets both, preserving vms-2af behaviour exactly.
  • cmd_set_symbol rewrite (dcl_cmd_set.c): resolves each parsed qualifier against the real set with VMS unique-prefix abbreviation, applies the /SCOPE change to the selected domain, and rejects /ALL+/GENERAL+/VERB combinations.

Clean-room / spec note (Rule 8, source-of-truth)

The item text asked for standalone /GLOBAL and /LOCAL qualifiers, but the DCL Dictionary has no such qualifiersLOCAL/GLOBAL are /SCOPE keywords (handled by vms-2af). Confirmed against three public sources (HPE V8.3 DCL Dictionary, VSI wiki, ODL V7.3): the qualifier list is /ALL /GENERAL /SCOPE /VERB only. Real DCL rejects SET SYMBOL/GLOBAL with %DCL-W-IVQUAL, so OVMX now emits an authentic %DCL-W-IVQUAL for any qualifier that is not a unique prefix of the real set (INV-DCL: honest error, never a silent accept). This is the VMS-matching behaviour; the deferred /GLOBAL///LOCAL premise is superseded rather than implemented as described.

Citation: VSI OpenVMS DCL Dictionary N–Z, SET SYMBOL (/ALL, /GENERAL, /SCOPE, /VERB).

Testing

  • New tests/dcl/test_symbol_scope_domain.sh (auto-discovered by the DCL harness — no CMake wiring needed). Differential test using the same FOO=="WRITE" (verb target) and BAR=="barval" (general subst) across three scenarios, so any behaviour change is attributable to the domain qualifier alone:
    • /SCOPE=NOGLOBAL/VERBFOO hidden from verb translation (%DCL-E-IVVERB), 'BAR' still expands.
    • /SCOPE=NOGLOBAL/GENERAL'BAR' hidden (GN_GEN=<>), FOOWRITE still runs.
    • /SCOPE=NOGLOBAL (/ALL) → both hidden.
    • SET SYMBOL/GLOBAL and /LOCAL%DCL-W-IVQUAL.
  • dcl-integration ctest green (4/4) with the change; vms-2af test_symbol_scope unaffected (no scope regression). The 3 HELP/INSTALL/ATTACH failures seen when running the harness standalone are pre-existing on clean origin/main (verified by stash-baseline: 133 pass / same 3 fail) and pass under the ctest environment.

No new cross-image symbols or TUs, so no native-link enumeration wiring was required.

🤖 Generated with Claude Code

…LOBAL /LOCAL IVQUAL)

Implements the SET SYMBOL command qualifiers deferred from vms-2af (#441,
which added /SCOPE + per-@-level local frames). Semantics are taken from the
public OpenVMS DCL Dictionary (VSI OpenVMS DCL Dictionary N-Z, SET SYMBOL),
which defines EXACTLY four command qualifiers:

  /SCOPE=(keyword,...)  the scope change (already implemented by vms-2af)
  /ALL      (default)   scope applies to BOTH first-token (verb) translation
                        AND general symbol substitution
  /GENERAL              scope applies to all symbols EXCEPT the first token
  /VERB                 scope applies ONLY to first-token (verb) translation

/ALL, /GENERAL and /VERB are mutually exclusive.

The scope state is now tracked per translation domain (general vs verb) in each
command-level frame. dcl_sym_get_ex(name, domain) consults the domain's flags;
the verb-position lookup in dcl_exec.c uses the VERB domain, all other lookups
the GENERAL domain, so /VERB and /GENERAL have a real, observable effect on the
symbol tables (verb translation can be hidden while general 'sym' substitution
still works, and vice-versa). /ALL (the default) sets both, preserving the
vms-2af behaviour exactly.

CLEAN-ROOM / SPEC NOTE (Rule 8, source-of-truth): the item text asked for
standalone /GLOBAL and /LOCAL qualifiers, but the DCL Dictionary has no such
qualifiers -- LOCAL/GLOBAL are /SCOPE *keywords* (handled by vms-2af). Real DCL
rejects "SET SYMBOL/GLOBAL" with %DCL-W-IVQUAL, so OVMX now emits an authentic
%DCL-W-IVQUAL for any qualifier that is not a unique prefix of the real set
(INV-DCL: honest error, never a silent accept). This is the VMS-matching
behaviour; the deferred /GLOBAL//LOCAL premise is superseded.

Test: tests/dcl/test_symbol_scope_domain.sh (auto-discovered by the DCL harness)
-- differential proof that /VERB and /GENERAL split the two translation domains,
plus /GLOBAL//LOCAL -> IVQUAL. dcl-integration ctest green (4/4); vms-2af
test_symbol_scope unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@baron-3dl
baron-3dl merged commit e56f46e into main Aug 13, 2026
68 checks passed
baron-3dl added a commit that referenced this pull request Aug 13, 2026
…tes real OVMX code) (#500)

Bump OVMX_PRODUCT_VERSION V0.4-3 → V0.4-4. ~12 PRs since V0.4-3. Headline:
OVMX's own toolchain now builds real OVMX code to a running image INSIDE OVMX.

  SELF-HOST IN-GUEST   MMK.EXE drives TCC→LIBRARIAN→LINK over its mailbox DCL vs
                       real /dev/vms: #476 compile-in-QEMU (first-ever TCC-in-guest),
                       #488 archive, #493 full compile→archive→LINK→ACTIVATE (linked
                       OVMXRT.EXE IMGACT-activates + runs, exit 216), byte-identical,
                       CI-gated from clean archive. (BUILD.COM retirement → vms-89d.)
  UX FIDELITY          #461 DIRECTORY wildcards/ellipsis · #478 COPY/DELETE/RENAME
                       (explicit-version DELETE) · #481 HELP .HLB library · #487 SET
                       SYMBOL scope · #491 DCL ON/SET NOON error control
  BOOT INTEGRITY       #499 boot-smoke green (aligned 3 e2e tests to authentic
                       DELETE/DIRECTORY output; strengthened the fail-stop guard)
  + swept other threads' merged work

Co-authored-by: alice <alice@workspace.local>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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