Skip to content

Commit 5428b3f

Browse files
authored
Add Swift shebang to syntax (zyedidia#3451)
The Swift compiler can be run in "interpreter" mode, so it can run Swift "scripts" if they have a proper shebang and no file extension.
1 parent 2308bc5 commit 5428b3f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

runtime/syntax/swift.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ filetype: swift
22

33
detect:
44
filename: "\\.swift$"
5+
header: "^#!.*bin/(env +)?swift( |$)"
56

67
rules:
78

0 commit comments

Comments
 (0)