Skip to content

Update Kate Syntax Highlighting - #50

Open
5Stygian wants to merge 17 commits into
c3lang:mainfrom
5Stygian:main
Open

Update Kate Syntax Highlighting#50
5Stygian wants to merge 17 commits into
c3lang:mainfrom
5Stygian:main

Conversation

@5Stygian

@5Stygian 5Stygian commented Aug 16, 2026

Copy link
Copy Markdown

Additions:

  • Keywords that were not present in version 1.
  • User defined types and constants.
  • Module/object names and their members get highlighted with different colors.
  • Struct/enum members and methods get highlighted.
  • Hex and octal numbers (0xFF, 0o377) get their prefixes (0x, 0o) highlighted with a different color as the number itself (FF, 377).

No AI was used.

@ManuLinares

Copy link
Copy Markdown
Member

<item>this</item>??

maybe you can check

$ c3c --help | grep list
  --list-attributes          - List all attributes.
  --list-builtins            - List all builtins.
  --list-keywords            - List all keywords.
  --list-operators           - List all operators.
  --list-precedence          - List operator precedence order.
  --list-project-properties  - List all available keys used in project.json files.
  --list-manifest-properties - List all available keys used in manifest.json files.
  --list-targets             - List all architectures the compiler supports.
  --list-type-properties     - List all type properties.
  --list-asm                 - List all asm instructions for the current target.

and the grammar https://c3-lang.org/implementation-details/grammar/

@ManuLinares

Copy link
Copy Markdown
Member

@5Stygian

Copy link
Copy Markdown
Author

Just noticed that highlighting hexadecimals and octals doesn't work properly. I'll have to fix that later.

error_with_hex_and_octal_highlighting_c3

@ManuLinares
ManuLinares marked this pull request as draft August 16, 2026 22:00
@ManuLinares

Copy link
Copy Markdown
Member

contract comments should be highlighted as comments since if not they are too noisy on Kate.

Comment thread kate/c3.xml Outdated
<item>import</item>
<item>in</item>
<item>inline</item>
<item>inout</item>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why?

Comment thread kate/c3.xml Outdated
<item>false</item>
<item>fault</item>
<item>import</item>
<item>in</item>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

Comment thread kate/c3.xml Outdated
<item>module</item>
<item>nextcase</item>
<item>null</item>
<item>out</item>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

same

@5Stygian 5Stygian Aug 17, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I was going to try to add highlighting to the @ rules within contracts, and in, out, and inout are keywords used by @param. I'll remove them in the next commit.

@5Stygian
5Stygian marked this pull request as ready for review August 17, 2026 21:48
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