Commits

guillermooo  committed 5e883b7

add syntax def for .sublime-macro files

  • Participants
  • Parent commits 31ba02d

Comments (0)

Files changed (2)

File Support/Sublime Macros.JSON-tmLanguage

+{ "name": "Sublime Text Macro",
+
+  "scopeName": "source.sublimemacro",
+
+  "fileTypes": ["sublime-macro"],
+
+  "patterns": [
+      { "begin": "(\\[)",
+        "beginCaptures": {
+            "1": { "name": "punctuation.definition.collection.start.sublimecommands" }
+        },
+        "end": "(\\])",
+        "endCaptures": {
+            "1": { "name": "punctuation.definition.collection.end.sublimecommands" }
+        },
+
+        "patterns": [
+            { "include": "#command" },
+            { "include": "#args" }
+        ]
+      }
+  ],
+
+  "repository": {
+
+      "args": {
+        "begin": "\"(args)\"\\s*:",
+        "beginCaptures": {
+            "1": { "name": "keyword.other.sublimecommands"}
+        },
+        "end": "(?<=\\})",
+        "name": "meta.definition.attached.command.arguments.sublimecommands",
+        "patterns": [
+            { "include": "source.jsongenericarray"
+            },
+            { "match": "\"([a-zA-Z0-9_]+)\"\\s*:",
+              "captures": {
+                  "1": { "name": "support.function.array.generic.key.sublimecommands" }
+              }
+            },
+            { "include": "source.jsongenericarrayelements"
+            },
+            { "match": "true|false|\\d+",
+              "name": "constant.numeric.sublimecommands"
+            },
+
+            { "match": "\\{",
+              "name": "punctuation.definition.array.keybinding.key.sequence"
+            }
+        ]
+      },
+
+      "command": {
+        "begin": "\\{",
+        "end": "\\}",
+        "patterns": [
+          { "match": "\"(command)\":\\s*\"([^\"]+)\"",
+            "captures": {
+              "1": { "name": "keyword.other.sublimecommands" },
+              "2": { "name": "string.attached.command.name.sublimecommands" }
+            }
+          },
+          { "include": "#args" }
+        ]
+      }
+  },
+
+  "uuid": "f56e1baa-51fc-4791-a9d9-21301f2e3a01"
+}

File Support/Sublime Macros.tmLanguage

+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>fileTypes</key>
+	<array>
+		<string>sublime-macro</string>
+	</array>
+	<key>name</key>
+	<string>Sublime Text Macro</string>
+	<key>patterns</key>
+	<array>
+		<dict>
+			<key>begin</key>
+			<string>(\[)</string>
+			<key>beginCaptures</key>
+			<dict>
+				<key>1</key>
+				<dict>
+					<key>name</key>
+					<string>punctuation.definition.collection.start.sublimecommands</string>
+				</dict>
+			</dict>
+			<key>end</key>
+			<string>(\])</string>
+			<key>endCaptures</key>
+			<dict>
+				<key>1</key>
+				<dict>
+					<key>name</key>
+					<string>punctuation.definition.collection.end.sublimecommands</string>
+				</dict>
+			</dict>
+			<key>patterns</key>
+			<array>
+				<dict>
+					<key>include</key>
+					<string>#command</string>
+				</dict>
+				<dict>
+					<key>include</key>
+					<string>#args</string>
+				</dict>
+			</array>
+		</dict>
+	</array>
+	<key>repository</key>
+	<dict>
+		<key>args</key>
+		<dict>
+			<key>begin</key>
+			<string>"(args)"\s*:</string>
+			<key>beginCaptures</key>
+			<dict>
+				<key>1</key>
+				<dict>
+					<key>name</key>
+					<string>keyword.other.sublimecommands</string>
+				</dict>
+			</dict>
+			<key>end</key>
+			<string>(?&lt;=\})</string>
+			<key>name</key>
+			<string>meta.definition.attached.command.arguments.sublimecommands</string>
+			<key>patterns</key>
+			<array>
+				<dict>
+					<key>include</key>
+					<string>source.jsongenericarray</string>
+				</dict>
+				<dict>
+					<key>captures</key>
+					<dict>
+						<key>1</key>
+						<dict>
+							<key>name</key>
+							<string>support.function.array.generic.key.sublimecommands</string>
+						</dict>
+					</dict>
+					<key>match</key>
+					<string>"([a-zA-Z0-9_]+)"\s*:</string>
+				</dict>
+				<dict>
+					<key>include</key>
+					<string>source.jsongenericarrayelements</string>
+				</dict>
+				<dict>
+					<key>match</key>
+					<string>true|false|\d+</string>
+					<key>name</key>
+					<string>constant.numeric.sublimecommands</string>
+				</dict>
+				<dict>
+					<key>match</key>
+					<string>\{</string>
+					<key>name</key>
+					<string>punctuation.definition.array.keybinding.key.sequence</string>
+				</dict>
+			</array>
+		</dict>
+		<key>command</key>
+		<dict>
+			<key>begin</key>
+			<string>\{</string>
+			<key>end</key>
+			<string>\}</string>
+			<key>patterns</key>
+			<array>
+				<dict>
+					<key>captures</key>
+					<dict>
+						<key>1</key>
+						<dict>
+							<key>name</key>
+							<string>keyword.other.sublimecommands</string>
+						</dict>
+						<key>2</key>
+						<dict>
+							<key>name</key>
+							<string>string.attached.command.name.sublimecommands</string>
+						</dict>
+					</dict>
+					<key>match</key>
+					<string>"(command)":\s*"([^"]+)"</string>
+				</dict>
+				<dict>
+					<key>include</key>
+					<string>#args</string>
+				</dict>
+			</array>
+		</dict>
+	</dict>
+	<key>scopeName</key>
+	<string>source.sublimemacro</string>
+	<key>uuid</key>
+	<string>f56e1baa-51fc-4791-a9d9-21301f2e3a01</string>
+</dict>
+</plist>