Files
peon-rewrite/peon-syntax-highlighting
nocturn9x 889a14731c Add default parameter values, fix relative imports, and add WaitQueue deque ops
Parser:
- Fix parseGenericConstraint to recognize '=' as a stop token, enabling
  fn foo(x: int64 = 0) syntax
- Fix parseModulePath and parseImportPath to handle '../' as a single
  token (the lexer greedily merges '..' and '/')

Typechecker:
- Relax isCapable to accept fewer arguments when trailing parameters
  have defaults
- Fill in default values for missing arguments in lowerResolvedCall

C runtime:
- Add peon_wait_queue_pop_back and peon_wait_queue_wake_last for O(1)
  tail removal, making WaitQueue a proper deque
- Rename wake_one -> wake_first for symmetry with wake_last

Stdlib:
- Move sync.pn into sync/ directory (events.pn, queues.pn)
- Fix Event.set() missing self.signaled = true assignment (deadlock bug)
- Add wakeLast and isEmpty bindings for WaitQueue
- Fix WaitQueue clone to use UFCS init() style

Syntax highlighting:
- Fix import path regex to support multiple ../ prefixes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 02:44:24 +02:00
..
2026-04-02 14:58:44 +02:00
2026-04-02 14:58:44 +02:00

Peon Syntax Highlighting

VS Code syntax highlighting for the Peon programming language.

This extension provides TextMate-based highlighting for Peon source files with the .pn and .peon extensions.

Features

  • Highlights Peon declarations such as fn, operator, type, iface, object, tuple, enum, var, let, and const, including async fn and async generator fn.
  • Recognizes Peon-specific syntax including #pragma[...], match/case, when, structured-concurrency keywords such as await, nursery, spawn, and shield, type-form keywords such as ref, lent, mut, and ptr, structural tuple literals like (x: 1, y: 2), and UFCS-style member access.
  • Supports Peon literals and operators including:
    • numeric suffixes like 1'i64 and 255'u8
    • binary, octal, hexadecimal, integer, and float literals
    • raw, byte, format, and triple-quoted strings
    • backticked identifiers and operator names such as `+` and `destroy=`
  • Configures editor behavior for Peon comments, brackets, quotes, and backticks.

Language Support

The extension currently contributes:

  • Language id: peon
  • File extensions: .pn, .peon
  • TextMate scope: source.peon

Development

To run the extension in a development host:

  1. Open this folder in VS Code.
  2. Press F5.
  3. In the Extension Development Host window, open a .pn file.

To build a VSIX package locally:

npx @vscode/vsce package

Known Limitations

  • This is a syntax-highlighting extension only. It does not currently provide formatting, diagnostics, semantic tokens, or language server features.
  • Highlighting is based on the current Peon manual and compiler implementation. If the language evolves, the grammar should be updated alongside compiler changes.

Release Notes

0.0.1

Initial syntax-highlighting release for Peon.