Skip to content

Commit

Permalink
Add support for F# package reference
Browse files Browse the repository at this point in the history
  • Loading branch information
MangelMaxime committed Apr 26, 2022
1 parent 66a6bc6 commit 2aa65db
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lexers/embedded/fsharp.xml
Expand Up @@ -169,6 +169,9 @@
<rule pattern="``([^`\n\r\t]|`[^`\n\r\t])+``">
<token type="Name"/>
</rule>
<rule pattern="#[ \t]*(if|endif|else|line|nowarn|light|r|\d+)\b">
<token type="CommentPreproc"/>
</rule>
<rule pattern="(!=|#|&amp;&amp;|&amp;|\(|\)|\*|\+|,|-\.|-&gt;|-|\.\.|\.|::|:=|:&gt;|:|;;|;|&lt;-|&lt;\]|&lt;|&gt;\]|&gt;|\?\?|\?|\[&lt;|\[\||\[|\]|_|`|\{|\|\]|\||\}|~|&lt;@@|&lt;@|=|@&gt;|@@&gt;)">
<token type="Operator"/>
</rule>
Expand All @@ -181,9 +184,6 @@
<rule pattern="\b(sbyte|byte|char|nativeint|unativeint|float32|single|float|double|int8|uint8|int16|uint16|int32|uint32|int64|uint64|decimal|unit|bool|string|list|exn|obj|enum)\b">
<token type="KeywordType"/>
</rule>
<rule pattern="#[ \t]*(if|endif|else|line|nowarn|light|\d+)\b.*?\n">
<token type="CommentPreproc"/>
</rule>
<rule pattern="[^\W\d][\w&#39;]*">
<token type="Name"/>
</rule>
Expand Down Expand Up @@ -242,4 +242,4 @@
</rule>
</state>
</rules>
</lexer>
</lexer>
1 change: 1 addition & 0 deletions lexers/testdata/fsharp/fsharp_package_reference.actual
@@ -0,0 +1 @@
#r "nuget: Newtonsoft.Json"
6 changes: 6 additions & 0 deletions lexers/testdata/fsharp/fsharp_package_reference.expected
@@ -0,0 +1,6 @@
[
{"type":"CommentPreproc","value":"#r"},
{"type":"Text","value":" "},
{"type":"LiteralString","value":"\"nuget: Newtonsoft.Json\""},
{"type":"Text","value":"\n"}
]

0 comments on commit 2aa65db

Please sign in to comment.