-
Notifications
You must be signed in to change notification settings - Fork 1.1k
update aiken language definition in prism #1691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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/ |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
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.
| /\b\d[\d_]*(?:\.\d*)?\b/ | |
| /\b\d[\d_]*(?:\.\d+)?\b/ |
| 'class-name': /\b[A-Z][a-zA-Z0-9_]*\b/, | ||
|
|
||
| // Function calls | ||
| 'function': /\b[a-z][a-zA-Z0-9_]*(?=\s*\()/, |
Copilot
AI
Dec 8, 2025
There was a problem hiding this comment.
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 ().
| 'function': /\b[a-z][a-zA-Z0-9_]*(?=\s*\()/, | |
| 'function': /\b[a-z][a-zA-Z0-9_]*(?=\()/, |
Checklist
yarn buildafter adding my changes without getting any errors.yarn.lock(or have removed these changes).Updating documentation or Bugfix
Updated Prism language definition for Aiken, converted from https://github.com/aiken-lang/site/blob/main/aiken.tmLanguage.json