LeviOP / tree-sitter-cfg

GoldSrc cfg grammar for tree-sitter.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tree-sitter-cfg

GoldSrc .cfg grammar for tree-sitter. This grammar and its highlights are mod-agnostic, and only attempt to replicate the way that GoldSrc tokenizes console commands.

While this grammar is designed to accurately parse GoldSrc configs, it will work fine for basic Source configs. Its usage for Source configs will start to break down if you try to parse more abstract things like quoted tokens without any white space (echo"test" and "echo"test are parsed very differently in Source and GoldSrc).

Known issues

  • Highlighting for some commands might not be accurate to the way GoldSrc handles the command. For example, the say command, instead of concatenating each argument of the command, takes all the arguments of the command as a string and uses this as what will be said. This means that things like comments and quoted tokens will not be interpreted as comments or quoted tokens, even though the highlighting makes it appear as though that is the case.

Usage

About

GoldSrc cfg grammar for tree-sitter.

License:MIT License


Languages

Language:C 77.7%Language:Rust 10.5%Language:JavaScript 5.3%Language:C++ 2.8%Language:Lua 1.4%Language:Python 1.2%Language:Scheme 1.1%