Skip to content

Conversation

@0xBora
Copy link
Member

@0xBora 0xBora commented Dec 7, 2025

Checklist

Updating documentation or Bugfix

Updated Prism language definition for Aiken, converted from https://github.com/aiken-lang/site/blob/main/aiken.tmLanguage.json

Before After
before after

Relevant to #1606

@0xBora 0xBora marked this pull request as ready for review December 7, 2025 19:28
@katomm katomm requested a review from Copilot December 8, 2025 10:46
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Prism syntax highlighting definition for the Aiken programming language by converting it from the official TextMate grammar specification. The changes improve code highlighting accuracy and coverage for Aiken language features.

Key changes:

  • Enhanced token definitions with more precise patterns for strings, numbers, and identifiers
  • Added support for additional number formats (binary, octal, hexadecimal) and updated keyword list
  • Introduced new token categories (namespace, function calls) and added language alias support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Hexadecimal
/\b0x[\da-fA-F]+\b/,
// Decimal (with optional decimal point)
/\b\d[\d_]*(?:\.\d*)?\b/
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The decimal number pattern allows trailing decimal points without digits (e.g., '123.'), which may not be valid Aiken syntax. Consider changing the pattern to /\b\d[\d_]*(?:\.\d+)?\b/ to require at least one digit after the decimal point.

Suggested change
/\b\d[\d_]*(?:\.\d*)?\b/
/\b\d[\d_]*(?:\.\d+)?\b/

Copilot uses AI. Check for mistakes.
'class-name': /\b[A-Z][a-zA-Z0-9_]*\b/,

// Function calls
'function': /\b[a-z][a-zA-Z0-9_]*(?=\s*\()/,
Copy link

Copilot AI Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The positive lookahead (?=\s*\() may not match function calls without whitespace before the parenthesis. Consider using (?=\() instead to match function() as well as function ().

Suggested change
'function': /\b[a-z][a-zA-Z0-9_]*(?=\s*\()/,
'function': /\b[a-z][a-zA-Z0-9_]*(?=\()/,

Copilot uses AI. Check for mistakes.
@katomm katomm merged commit 348de1d into staging Dec 11, 2025
4 checks passed
@katomm katomm deleted the aiken-syntax-highlights branch December 11, 2025 11:11
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.

3 participants