diff --git a/AppleScript/AppleScript.tmLanguage b/AppleScript/AppleScript.tmLanguage
index cc8123d..12586e5 100644
--- a/AppleScript/AppleScript.tmLanguage
+++ b/AppleScript/AppleScript.tmLanguage
@@ -23,7 +23,7 @@
|with \s+ timeout\b .*
|script\b .*
|( considering | ignoring )\b .*
- )\s*(--.*?)?$
+ )\s*((?:--|#).*?)?$
foldingStopMarker
^\s*end\b.*$
@@ -95,7 +95,7 @@
end
- ^\s*(end(?:\s+script)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+script)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -157,7 +157,7 @@
we can leave it like this though, as it sorta works.
end
- ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$)
+ ^\s*(end)(?:\s+(\2))?(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -213,7 +213,7 @@
comment
TODO: match `given` parameters
end
- ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$)
+ ^\s*(end)(?:\s+(\2))?(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -254,7 +254,7 @@
^(?x)
\s*(to|on)\s+ # "on" or "to"
(\w+) # function name
- (?=\s*(--.*?)?$) # nothing else
+ (?=\s*((?:--|\#).*?)?$) # nothing else
beginCaptures
@@ -270,7 +270,7 @@
end
- ^\s*(end)(?:\s+(\2))?(?=\s*(--.*?)?$)
+ ^\s*(end)(?:\s+(\2))?(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -315,7 +315,7 @@
begin
^\s*(considering)\b
end
- ^\s*(end(?:\s+considering)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+considering)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.considering.applescript
patterns
@@ -366,7 +366,7 @@
begin
^\s*(ignoring)\b
end
- ^\s*(end(?:\s+ignoring)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+ignoring)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.ignoring.applescript
patterns
@@ -425,7 +425,7 @@
end
- ^\s*(end(?:\s+if)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+if)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -474,7 +474,7 @@
end
- ^\s*(end(?:\s+(try|error))?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+(try|error))?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -534,7 +534,7 @@
end
- ^\s*(end(?:\s+using\s+terms\s+from)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+using\s+terms\s+from)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -565,7 +565,7 @@
end
- ^\s*(end(?:\s+timeout)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+timeout)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -596,7 +596,7 @@
end
- ^\s*(end(?:\s+transaction)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+transaction)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -638,7 +638,7 @@
end
- ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+repeat)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -674,7 +674,7 @@
end
- ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+repeat)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -715,7 +715,7 @@
end
- ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+repeat)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -748,7 +748,7 @@
begin
- ^\s*(repeat)\b(?=\s*(--.*?)?$)
+ ^\s*(repeat)\b(?=\s*((?:--|#).*?)?$)
beginCaptures
1
@@ -758,7 +758,7 @@
end
- ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+repeat)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -789,7 +789,7 @@
end
- ^\s*(end(?:\s+repeat)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+repeat)?)(?=\s*((?:--|#).*?)?$)
endCaptures
1
@@ -988,7 +988,7 @@
begin
- \b(if)\b(?=.*\bthen\b(?!\s*(--.*?)?$))
+ \b(if)\b(?=.*\bthen\b(?!\s*((?:--|#).*?)?$))
beginCaptures
1
@@ -1029,7 +1029,7 @@
comment
tell Textmate
end
- ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+tell)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.tell.application.textmate.applescript
patterns
@@ -1062,7 +1062,7 @@
comment
tell Finder
end
- ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+tell)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.tell.application.finder.applescript
patterns
@@ -1095,7 +1095,7 @@
comment
tell System Events
end
- ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+tell)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.tell.application.system-events.applescript
patterns
@@ -1128,7 +1128,7 @@
comment
tell iTunes
end
- ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+tell)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.tell.application.itunes.applescript
patterns
@@ -1161,7 +1161,7 @@
comment
tell generic application process
end
- ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+tell)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.tell.application-process.generic.applescript
patterns
@@ -1190,7 +1190,7 @@
comment
tell generic application
end
- ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+tell)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.tell.application.generic.applescript
patterns
@@ -1219,7 +1219,7 @@
comment
generic tell block
end
- ^\s*(end(?:\s+tell)?)(?=\s*(--.*?)?$)
+ ^\s*(end(?:\s+tell)?)(?=\s*((?:--|#).*?)?$)
name
meta.block.tell.generic.applescript
patterns
@@ -1521,6 +1521,20 @@
name
comment.line.double-dash.applescript
+
+ captures
+
+ 1
+
+ name
+ punctuation.definition.comment.applescript
+
+
+ match
+ (#).*$\n?
+ name
+ comment.line.hash.applescript
+
begin
\(\*