Skip to content

SET PROCEDURE: routines in procedure files are found - #5

Merged
RandomChirp merged 1 commit into
FoxDevCommunity:mainfrom
jefflroberts:set-procedure
Sep 24, 2026
Merged

RandomChirp merged 1 commit into
FoxDevCommunity:mainfrom
jefflroberts:set-procedure

Conversation

@jefflroberts

Copy link
Copy Markdown
Collaborator

SET PROCEDURE TO was accepted and ignored, so a bare call into a procedure file failed, which stops a CodeMine application at its first line. Now the files are loaded through the host's LoadProgram, as DO loads a program, without running their main body. A bare call or DO looks in the current program, then the procedure files in the order listed, then the programs that have run.

Measured in Visual FoxPro 9 and written into the set_procedure golden, whose .expected was produced by vfp9.exe:

  • ADDITIVE appends; a file already listed stays where it is.
  • Without ADDITIVE the list is emptied first and files go on as they load, so a missing file (error 1, "File 'x.prg' does not exist.") keeps the ones before it and drops what was listed before.
  • RELEASE PROCEDURE takes a file off, and its routines stop being found, while a program that ran with DO keeps its routines findable after it returns.
  • SET("PROCEDURE") answers each file's full .FXP path, quoted, comma-separated.
  • A call to a name that is no routine anywhere runs the program of that name, and is error 1 when there is none (it was error 1162).
  • DO name+"text" builds the program's name when the + is written against the name; with spaces round it the product calls it a syntax error (DO: prg name concatenation doesn't work #1).

The mock host can now hold program sources and load one when LoadProgram asks, which is how the golden gets its procedure files through the same path the IDE's host takes. The IDE's own "does not exist" message now uses the product's wording, and SET PROCEDURE moves from "accepted and ignored" to "runs" in the language coverage map.

Verification. The set_procedure golden, crates/foxvm/tests/procedures.rs, and the full VM suite.

This is independent of #2. A few more pull requests from the same application (a CodeMine app, Shutter Ace) will follow, split by topic.

Closes #3. Fixes #1.

🤖 Generated with Claude Code

SET PROCEDURE TO was accepted and ignored, so a bare call into a procedure file
failed - which stops a CodeMine application at its first line. Now the files
are loaded through the host's LoadProgram, as DO loads a program, without
running their main body, and a bare call or DO looks in the current program,
then the procedure files in the order listed, then the programs that have run.

Measured in Visual FoxPro 9 and written into the set_procedure golden:
- ADDITIVE appends; a file already listed stays where it is
- without ADDITIVE the list is emptied first and files go on as they load, so
  a missing file (error 1, "File 'x.prg' does not exist.") keeps the ones
  before it and drops what was listed before
- RELEASE PROCEDURE takes a file off, and its routines stop being found, while
  a program that ran with DO keeps its routines findable after it returns
- SET("PROCEDURE") answers each file's full .FXP path, quoted, comma-separated
- a call to a name that is no routine anywhere runs the program of that name,
  and is error 1 when there is none (it was error 1162)
- DO name+"text" builds the program's name when the + is written against the
  name; with spaces round it the product calls it a syntax error (FoxDevCommunity#1)

The mock host can now hold program sources and load one when LoadProgram asks,
which is how the golden gets its procedure files through the same path the
IDE's host takes. The IDE's own "does not exist" message now uses the
product's wording. SET PROCEDURE moves from "accepted and ignored" to "runs"
in the language coverage map.

Closes FoxDevCommunity#3. Fixes FoxDevCommunity#1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@RandomChirp RandomChirp 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.

The golden set_procedure.prg agrees with vfp9.exe, the fixtures are ASCII, and cargo test -p foxvm is green on a merge with main.

I measured the DO rule the parser encodes: DO p_cod+"x" written without spaces runs, the same line with spaces round the + is error 10, and DO (expr) runs. That is what the product does, so the unspaced-only rule is right.

One thing before it can merge: main now has a DO "quoted name" block at the same spot in crates/foxvm/src/parser.rs (from #2), so the branch conflicts. The resolution that passes every test is to keep the quoted-name block from main first, with its own tail, and put this branch's name+expression block after it, with its tail. A rebase on main with that ordering is all it needs.

Review generated with Claude Code (Claude Fable 5.1), run against vfp9.exe and the test suites on a merge with main.

@RandomChirp
RandomChirp merged commit 6aa0c3d into FoxDevCommunity:main Sep 24, 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.

SET PROCEDURE: routines in procedure files are not found DO: prg name concatenation doesn't work

2 participants