package tm-grammars

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file tm_grammar_openscad.ml

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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
let lang_id = "openscad"
let json = {json|{
  "displayName": "OpenSCAD",
  "fileTypes": [
    "scad"
  ],
  "foldingStartMarker": "/\\*\\*|\\{\\s*$",
  "foldingStopMarker": "\\*\\*/|^\\s*}",
  "name": "openscad",
  "patterns": [
    {
      "captures": {
        "1": {
          "name": "keyword.control.scad"
        }
      },
      "match": "^(module)\\s.*$",
      "name": "meta.function.scad"
    },
    {
      "match": "\\b(if|else|for|intersection_for|assign|render|function|include|use)\\b",
      "name": "keyword.control.scad"
    },
    {
      "begin": "/\\*\\*(?!/)",
      "captures": {
        "0": {
          "name": "punctuation.definition.comment.scad"
        }
      },
      "end": "\\*/",
      "name": "comment.block.documentation.scad"
    },
    {
      "begin": "/\\*",
      "captures": {
        "0": {
          "name": "punctuation.definition.comment.scad"
        }
      },
      "end": "\\*/",
      "name": "comment.block.scad"
    },
    {
      "captures": {
        "1": {
          "name": "punctuation.definition.comment.scad"
        }
      },
      "match": "(//).*$\\n?",
      "name": "comment.line.double-slash.scad"
    },
    {
      "begin": "\"",
      "end": "\"",
      "name": "string.quoted.double.scad",
      "patterns": [
        {
          "match": "\\\\.",
          "name": "constant.character.escape.scad"
        }
      ]
    },
    {
      "begin": "'",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.string.begin.scad"
        }
      },
      "end": "'",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.string.end.scad"
        }
      },
      "name": "string.quoted.single.scad",
      "patterns": [
        {
          "match": "\\\\(x\\h{2}|[012][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)",
          "name": "constant.character.escape.scad"
        }
      ]
    },
    {
      "begin": "\"",
      "beginCaptures": {
        "0": {
          "name": "punctuation.definition.string.begin.scad"
        }
      },
      "end": "\"",
      "endCaptures": {
        "0": {
          "name": "punctuation.definition.string.end.scad"
        }
      },
      "name": "string.quoted.double.scad",
      "patterns": [
        {
          "match": "\\\\(x\\h{2}|[012][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)",
          "name": "constant.character.escape.scad"
        }
      ]
    },
    {
      "match": "\\b(abs|acos|asun|atan2??|ceil|cos|exp|floor|ln|log|lookup|max|min|pow|rands|round|sign|sin|sqrt|tan|str|cube|sphere|cylinder|polyhedron|scale|rotate|translate|mirror|multimatrix|color|minkowski|hull|union|difference|intersection|echo)\\b",
      "name": "support.function.scad"
    },
    {
      "match": ";",
      "name": "punctuation.terminator.statement.scad"
    },
    {
      "match": ",[\\t |]*",
      "name": "meta.delimiter.object.comma.scad"
    },
    {
      "match": "\\.",
      "name": "meta.delimiter.method.period.scad"
    },
    {
      "match": "[{}]",
      "name": "meta.brace.curly.scad"
    },
    {
      "match": "[()]",
      "name": "meta.brace.round.scad"
    },
    {
      "match": "[]\\[]",
      "name": "meta.brace.square.scad"
    },
    {
      "match": "[!$%\\&*]|--?|\\+\\+|[+~]|===?|=|!==??|<=|>=|<<=|>>=|>>>=|<>|[!<>]|&&|\\|\\||\\?:|\\*=|(?<!\\()/=|%=|\\+=|-=|&=|\\^=|\\b(in|instanceof|new|delete|typeof|void)\\b",
      "name": "keyword.operator.scad"
    },
    {
      "match": "\\b((0([Xx])\\h+)|([0-9]+(\\.[0-9]+)?))\\b",
      "name": "constant.numeric.scad"
    },
    {
      "match": "\\btrue\\b",
      "name": "constant.language.boolean.true.scad"
    },
    {
      "match": "\\bfalse\\b",
      "name": "constant.language.boolean.false.scad"
    }
  ],
  "scopeName": "source.scad"
}|json}