diff options
| author | Elwardi <elwardifadeli@gmail.com> | 2021-12-14 13:45:56 +0100 |
|---|---|---|
| committer | Stephan Seitz <stephan.seitz@fau.de> | 2022-01-08 13:20:52 +0100 |
| commit | 16e77495c45a2e3794af72f09de717f81ea418a2 (patch) | |
| tree | f1a295c58ae112e0d2b28b31558857add5c7472b /queries/foam/highlights.scm | |
| parent | 50fee51d352317aaed28532c5f2f3f5e44fdd7bc (diff) | |
Add OpenFOAM parser
Diffstat (limited to 'queries/foam/highlights.scm')
| -rw-r--r-- | queries/foam/highlights.scm | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/queries/foam/highlights.scm b/queries/foam/highlights.scm new file mode 100644 index 00000000..ea895cf9 --- /dev/null +++ b/queries/foam/highlights.scm @@ -0,0 +1,61 @@ +;; Comments +(comment) @comment + +;; Generic Key-value pairs and dictionary keywords +(key_value + keyword: (identifier) @function +) +(dict + key: (identifier) @type +) + +;; Macros +(macro + "$" @conditional + (prev_scope)* @conditional + (identifier)* @namespace +) + + +;; Directives +"#" @conditional +(preproc_call + directive: (identifier)* @conditional + argument: (identifier)* @namespace +) +( + (preproc_call + argument: (identifier)* @namespace + ) @conditional + (#match? @conditional "ifeq") +) +( + (preproc_call) @conditional + (#match? @conditional "(else|endif)") +) + +;; Literal numbers and strings +(number_literal) @float +(string_literal) @string +(escape_sequence) @escape + +;; Treat [m^2 s^-2] the same as if it was put in numbers format +(dimensions dimension: (identifier) @float) + +;; Punctuation +[ + "(" + ")" + "[" + "]" + "{" + "}" + "#{" + "#}" + ";" +] @punctuation + +;; Special identifiers +([(identifier) "on" "off" "true" "false" "yes" "no"] @attribute +(#match? @attribute "^(uniform|non-uniform|and|or|on|off|true|false|yes|no)$") +) |
