diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-27 14:00:49 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-27 14:00:49 +0000 |
| commit | 5d37ebcc02f6ca2ce1ced93f803dd1daf634d866 (patch) | |
| tree | 4c955f89e1f43aefe66064e34e547625eba3bc1b /bundle | |
| parent | 3d7d1d7cf8685f0d9230cd89d06017869da1c6d8 (diff) | |
feat(editor): support PP directives in VS Code and Bundle
Share preprocessor highlighting through the existing grammar, keep conditional
blocks at the ordinary indentation depth, and exercise switches in Bundle's
native runner test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'bundle')
| -rw-r--r-- | bundle/README.md | 2 | ||||
| -rw-r--r-- | bundle/src-tauri/src/runner.rs | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/bundle/README.md b/bundle/README.md index 6147fc0..44fd4a0 100644 --- a/bundle/README.md +++ b/bundle/README.md @@ -8,6 +8,8 @@ Shortcuts use Cmd on macOS and Ctrl on Windows: **N** new, **Shift+N** new windo Nightly provides a standalone Windows x64 `.exe` and a macOS Apple Silicon `.tar.xz` containing the `.app`. Windows extracts the included `cpsc.exe` into the current working directory on startup; macOS keeps it inside the `.app`. Windows uses the system WebView2 runtime. +The editor shares the VS Code plugin's highlighting and indentation rules, including PP_DEFINE, PP_UNDEF, PP_IFDEF, PP_IFNDEF and PP_ENDIF. Preprocessor conditions do not add indentation. The included compiler supports these file-local switches and uses PP_DEFINE __LIB for library code. + For development and build instructions, see [AGENTS/DEVELOPMENT.md](AGENTS/DEVELOPMENT.md). At startup the Bundle checks whether a newer nightly exists and tells you where to download it; it never updates itself. diff --git a/bundle/src-tauri/src/runner.rs b/bundle/src-tauri/src/runner.rs index f8fa353..e0831e8 100644 --- a/bundle/src-tauri/src/runner.rs +++ b/bundle/src-tauri/src/runner.rs @@ -184,6 +184,12 @@ mod tests { let runner = Runner::default(); for (program, input, expected, code) in [ ( + "PP_DEFINE Enabled\nPP_IFDEF Enabled\nOUTPUT 1\nPP_ENDIF\nPP_UNDEF Enabled\nPP_IFNDEF Enabled\nOUTPUT 2\nPP_ENDIF\n", + "", + "1\n2\n", + 0, + ), + ( "DECLARE N : INTEGER\nINPUT N\nOUTPUT N\nOUTPUT \"\\U0001F600\"\n", "42\n", "42\nš\n", |
