File: v.yaml

package info (click to toggle)
micro 2.0.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 2,828 kB
  • sloc: sh: 247; makefile: 77; xml: 53
file content (80 lines) | stat: -rw-r--r-- 2,631 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
filetype: v

detect:

rules:
      # Conditionals and control flow
    - preproc: "\\b(module|import)\\b"
    - statement: "\\b(if|else|for|match|select|defer|or|unsafe)\\b"
    - statement: "\\b(break|continue|goto|return)\\b"
    - type.keyword: "\\b(assert|const|enum|fn|struct|interface|type)\\b"
    - type.keyword: "\\b(pub|mut|__global)\\b"

    - preproc: "\\$\\b(if|else)\\b"
    - identifier.os: "\\b(mac|macos|linux|windows|freebsd|openbsd|netbsd|dragonfly|android|solaris|haiku)\\b"
    - identifier.compiler: "\\b(gcc|tinyc|clang|mingw|msvc|cplusplus)\\b"
    - identifier.platform: "\\b(amd64|aarch64|x64|x32|little_endian|big_endian)\\b"
    - identifier.other: "\\b(debug|test|js|glibc|prealloc|no_bounds_checking)\\b"

    - identifier.class: "\\b([A-Z][A-Za-z0-9_]*)\\b"
    - identifier.function: "\\b([a-z_]+\\()"
    - symbol.operator: "\\b(i[ns])\\b|[-+/*<>!=~*%&:|,.?]"
    - symbol.attribute:
        start: "^\\["
        end: "\\]$"
        rules:
            - default: ".*"
            - symbol: "\\b(deprecated|direct_array_access|if|inline|live|ref_only|typedef|windows_stdcall)\\b"

      # Types
    - type: "\\b(byte|u(16|32|64|128)|i(nt|8|16|64|128)|f(32|64))\\b"
    - type: "\\b(bool|cha[nr]|map|rune|string)\\b"
    - type: "\\b(any(_int|_float)?|size_t|(uint|byte|char|void)ptr)\\b"
    - constant.bool: "\\b(true|false)\\b"
    - constant.none: "\\b(none)\\b"

      # Brackets
    - symbol.brackets: "(\\{|\\})"
    - symbol.brackets: "(\\(|\\))"
    - symbol.brackets: "(\\[|\\])"

      # Numbers and strings
    - constant.number: "\\b(0b[01_]+)\\b"
    - constant.number: "\\b(0o[0-7_]+)\\b"
    - constant.number: "\\b(0x[0-9a-fA-F_]+)\\b"
    - constant.number: "\\b([0-9_]+)\\b"

    - constant.string:
        start: "\""
        end: "\""
        skip: "\\\\."
        rules:
            - constant.specialChar: "%."
            - constant.specialChar: "\\\\[abefnrtv'\\\"\\\\]"
            - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"

    - constant.string:
        start: "'"
        end: "'"
        skip: "\\\\."
        rules:
            - constant.specialChar: "%."
            - constant.specialChar: "\\\\[abefnrtv'\\\"\\\\]"
            - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})"

    - constant.string:
        start: "`"
        end: "`"
        rules: []

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

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