B#/Bsharp Compiler
VS Code language support and a grid runner for B#/Bsharp.
Included
.my and B# file language registration, shown as B#/Bsharp
- Syntax highlighting for common tokens
- Bracket auto-closing
- Run the active file in VS Code's integrated terminal
- Built-in module imports:
imp Gr, imp ife, imp Fw, imp tm, and imp nt
- Import
Gr before using grid commands; import nt before @ notes/comments
- Imports go before program code; unused modules don't need to be imported
- A 4x4 grid, expandable with
GS:*N*: to any size from 4x4 through 16x16
- Grid commands:
+ and - change the current cell; >, <, v, and ^
move the pointer with wrapping; P prints the whole grid
- Breakpoints and source-line stepping in the bundled source debugger
- Example command:
B#/Bsharp: Hello
The import system validates known module names, rejects duplicate imports, and
requires imports to appear before program code. imp Gr is required before
grid commands and GS:*N*: directives. imp nt enables @ line notes.
imp ife, imp Fw, and imp tm are recognized as reserved built-in modules;
their conditional, loop, and time/math instructions are not implemented yet.
The runner requires modules for the features it currently implements, rather
than requiring every module in every file.
Unknown modules, duplicate imports, and imports after code are reported as
errors.
The debugger remains a source-line debugger; it does not evaluate B# expressions.
Run in the current VS Code window
With the extension enabled, open a .my or other registered B# source file,
then click the play button in the editor title bar or run
B#/Bsharp: Run in Integrated Terminal from the Command Palette.
The grid output appears in an integrated terminal tab in the same VS Code
window.
Do not use F5 to run a B# program while developing the extension: F5 starts
the Extension Development Host in a second window. The Run button and Command
Palette command run the B# file in the current window's integrated terminal.
The ife, Fw, and tm imports are currently reserved names only. Conditions
such as {=...} and (=...) are not implemented yet and will report that
limitation explicitly.