Files
Marcos Paulo eb1245bd20
ci / ci (macos-latest) (push) Has been cancelled
ci / ci (ubuntu-latest) (push) Has been cancelled
ci / ci (windows-latest) (push) Has been cancelled
fix: tab switch freeze (unlinked scan off the UI thread); assistant: vault MCP wiring, preamble, wrapping choices, presets; 23 grammars incl. Twig; Tasks query, Templater include, icon picker
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-21 13:36:33 -03:00

55 lines
1.6 KiB
YAML

%YAML 1.2
---
# NotesCraft's own Nix grammar. Original work written for this project; not copied
# from any other grammar. Regexes stay linear: no nested quantifiers, so nothing backtracks far.
# Strings end at their line unless the language allows multi-line ones.
name: Nix
file_extensions: [nix]
scope: source.nix
contexts:
main:
- match: '/\*'
scope: punctuation.definition.comment.begin
push: block0
- match: '#.*'
scope: comment.line
- match: '\b[A-Za-z_][\w''-]*(?=\s*=[^=])'
scope: meta.mapping.key
- match: '\b(?:builtins|import|derivation|throw|abort|toString)\b'
scope: support.function
- match: ''''''
scope: punctuation.definition.string.begin
push: str-nix
- match: '"'
scope: punctuation.definition.string.begin
push: str-dq
- match: '\b(?:assert|else|if|in|inherit|let|or|rec|then|with)\b'
scope: keyword.control
- match: '\b(?:true|false|null)\b'
scope: constant.language
- match: '\b(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\d[\d_]*(?:\.\d[\d_]*)?(?:[eE][+-]?\d+)?)\b'
scope: constant.numeric
- match: '[-+*/%=<>!&|^~?:]+'
scope: keyword.operator
block0:
- meta_scope: comment.block
- match: '\*/'
pop: true
str-nix:
- meta_scope: string.quoted.double-single
- match: '\\.'
scope: constant.character.escape
- match: ''''''
scope: punctuation.definition.string.end
pop: true
str-dq:
- meta_scope: string.quoted.double
- match: '\\.'
scope: constant.character.escape
- match: '"'
scope: punctuation.definition.string.end
pop: true
- match: '(?=\n)'
pop: true