Skip to content

Fix interpreter strict/pragma handling and debugger improvements#288

Merged
fglock merged 5 commits intomasterfrom
fix-interpreter-strict-and-debugger
Mar 9, 2026
Merged

Fix interpreter strict/pragma handling and debugger improvements#288
fglock merged 5 commits intomasterfrom
fix-interpreter-strict-and-debugger

Conversation

@fglock
Copy link
Owner

@fglock fglock commented Mar 9, 2026

Summary

Fixes and improvements after #287:

  • Fix debugger-related test regressions: Handle edge cases in debugger initialization
  • Fix interpreter: process CompilerFlagNode for pragmas in eval: Ensure use strict and other pragmas work correctly in eval strings when using the interpreter backend
  • Fix strict vars for Unicode identifiers above Latin-1 range: Unicode characters > 255 (like Greek α) are now properly blocked under strict vars
  • Add debugger documentation to workshop slides: Document debugger in presentation materials
  • Debugger: die instead of hanging when stdin is not a tty: Use POSIX isatty() to detect non-interactive stdin and fail fast instead of blocking

Test plan

  • mvn test passes
  • eval qq/ use strict; \$\x{3b1} / now correctly throws strict error
  • Debugger in non-interactive context exits immediately instead of hanging

Generated with Devin

fglock and others added 5 commits March 9, 2026 14:30
- Add PERL5DB environment variable support
  - Execute PERL5DB code to define custom DB::DB
  - Call user DB::DB instead of interactive debugger when defined

- Fix %ENV inheritance in child processes
  - Copy Perl %ENV hash to ProcessBuilder environment
  - Ensures local $ENV{...} changes propagate to backticks/system()

- Silence JVM VerifyError fallback message
  - Make message conditional on SHOW_FALLBACK flag

Test impact:
- op/debug.t: Tests 1-2 now pass
- run/switchd.t: Requires -d:Module syntax (not implemented)

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
The interpreter backend was not applying strict/warnings/features from
pragmas like 'use strict' inside eval strings. This happened because
CompilerFlagNode was marked with compileTimeOnly=true, and BytecodeCompiler
was skipping all such nodes.

Unlike the JVM emitter which visits CompilerFlagNode to set flags on the
symbol table, BytecodeCompiler was completely ignoring it. This fix adds
special handling to visit CompilerFlagNode before the compileTimeOnly check,
allowing pragmas to properly affect the compilation of subsequent statements.

Test case: eval q{ use strict; $x } - now correctly reports:
"Global symbol "\$x" requires explicit package name"

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
The isNonAsciiLengthOneScalarAllowedUnderNoUtf8 function was incorrectly
allowing all non-ASCII characters (c > 127) as special variables under
'no utf8'. This should only apply to Latin-1 extended characters (128-255).

Unicode characters above 255 (like Greek α = 945) should be treated as
normal identifiers and blocked under strict vars.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
- Add debugger bullet point to intro slides "What You Get" section
- Add full debugger slide with command reference to technical slides
- Update roadmap to reflect debugger is now stable

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
Use POSIX isatty() to detect non-interactive stdin and throw an error
immediately instead of blocking forever waiting for input. This prevents
test hangs when -d flag is used in non-interactive contexts.

Generated with [Devin](https://cli.devin.ai/docs)

Co-Authored-By: Devin <noreply@cognition.ai>
@fglock fglock merged commit 88f882a into master Mar 9, 2026
2 checks passed
@fglock fglock deleted the fix-interpreter-strict-and-debugger branch March 9, 2026 13:39
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