]> git.lizzy.rs Git - micro.git/commitdiff
Support csharp-script syntax. (#1425)
authortrrbl <domi@outlook.at>
Fri, 10 Apr 2020 17:57:36 +0000 (19:57 +0200)
committerGitHub <noreply@github.com>
Fri, 10 Apr 2020 17:57:36 +0000 (13:57 -0400)
```
#!/usr/bin/env dotnet-script
// Set Runtime
#! "netcoreapp3.0"
// Imports
#load "myAssembly.dll"
#r "nuget:CliWrap,2.5.0"
```
This syntax file basically imports the `csharp` rules and adds it's custom pre-processors.

runtime/syntax/csx.yaml [new file with mode: 0644]

diff --git a/runtime/syntax/csx.yaml b/runtime/syntax/csx.yaml
new file mode 100644 (file)
index 0000000..a3a13a6
--- /dev/null
@@ -0,0 +1,8 @@
+filetype: csharp-script
+detect:
+    filename: "\\.csx$"
+    header: "^#!.*/(env +)?dotnet-script( |$)"
+    
+rules:
+    - include: "csharp"
+    - preproc: "\\B(\\#!|\\#[r|load|]+\\b)"