Skip to content

Conversation

@MorphCodeBot
Copy link
Collaborator

Overview

Moved C++ primitive types (int, char, etc.) from RESERVED_TYPES to RESERVED_KEYWORDS to highlight them as keywords for more natural syntax highlighting.

Changes Made

  • Moved primitive types to RESERVED_KEYWORDS array in cpp.js:
    • bool
    • char (including char8_t, char16_t, char32_t)
    • double
    • float
    • int
    • long
    • short
    • void
    • wchar_t
  • Emptied the RESERVED_TYPES array
  • Maintained alphabetical ordering in RESERVED_KEYWORDS

Rationale

  1. Aligns with C++ standard where primitive types are technically keywords
  2. Matches common highlighting in popular IDEs (VS Code, CLion, XCode, Notepad++)
  3. Improves readability and familiarity for C++ developers

Testing

  • Verified correct highlighting of primitive types
  • Ensured existing tests pass
  • Added new test cases for primitive type highlighting

Additional ticket processing details

Moved primitive types (int, char, etc.) from RESERVED_TYPES to RESERVED_KEYWORDS
to match C++ standard and common IDE behavior.

Fixes PLAYGROUND-PR-3316
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.

2 participants