Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions runtime/syntax/gleam.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
filetype: gleam

detect:
filename: "\\.gleam$"

rules:
- statement: "\\b(as|assert|auto|case|const|delegate|derive|echo|else|fn|if|implement|import|let|macro|opaque|panic|pub|test|todo|type|use)\\b"

- type: "\\b(Int|Float|String|Bool|List|Option|Result|BitArray)\\b"

- constant: "\\b(True|False|Nil)\\b"

- type: "\\b[A-Z][a-zA-Z0-9_]*\\b"

- preproc: "@[a-z][a-z_]*"

- statement: "(\\|>|->|<-)"
- statement: "(\\.\\.|<>)"
- statement: "(==|!=|<=\\.|>=\\.|<\\.|>\\.|<=|>=)"
- statement: "(&&|\\|\\|)"
- statement: "(\\+\\.|-\\.|\\*\\.|/\\.|\\+|-|\\*|/|%)"
- statement: "(=|<|>|!|<<|>>)"

- constant.number: "\\b0b[01](_?[01])*\\b"
- constant.number: "\\b0o[0-7](_?[0-7])*\\b"
- constant.number: "\\b0x[0-9a-fA-F](_?[0-9a-fA-F])*\\b"
- constant.number: "\\b[0-9](_?[0-9])*(\\.[0-9](_?[0-9])*)?([eE][+-]?[0-9](_?[0-9])*)?\\b"

- special: "#\\("

- constant.string:
start: '"'
end: '"'
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."

Comment on lines +34 to +37
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
skip: "\\\\."
skip: "\\\\."
rules:
- constant.specialChar: "\\\\."

Copy link
Author

@HiwarkhedePrasad HiwarkhedePrasad Mar 16, 2026

Choose a reason for hiding this comment

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

Hi @Andriamanitra, thanks again for the detailed feedback! I've made all the suggested changes:

  • Numbers now support underscores (e.g., 1_000_000)
  • Added float comparison operators (<., >., <=., >=.)
  • String escapes are now highlighted as special characters
  • Added tuple syntax #(...) highlighting
  • Attributes are now restricted to lowercase only

- comment:
start: "//"
end: "$"
rules:
- todo: "(TODO|FIXME|XXX):?"