Skip to content

Instantly share code, notes, and snippets.

@davisp
Created October 6, 2020 15:36
Show Gist options
  • Save davisp/c12767385f45d229afe9cddcab3f0924 to your computer and use it in GitHub Desktop.
Save davisp/c12767385f45d229afe9cddcab3f0924 to your computer and use it in GitHub Desktop.
diff --git a/Syntaxes/Erlang.xml b/Syntaxes/Erlang.xml
index 2cf39d8..097c205 100644
--- a/Syntaxes/Erlang.xml
+++ b/Syntaxes/Erlang.xml
@@ -256,6 +256,7 @@
<include syntax="self" collection="keyword" />
<include syntax="self" collection="textual-operator" />
<include syntax="self" collection="function-call" />
+ <include syntax="self" collection="map" />
<include syntax="self" collection="tuple" />
<include syntax="self" collection="list" />
<include syntax="self" collection="binary" />
@@ -595,6 +596,28 @@
</scope>
</collection>
+ <collection name="map">
+ <scope name="erlang.internal.map">
+ <starts-with>
+ <expression>(\#)\s*(\{)</expression>
+ <capture number="1" name="erlang.keyword.map" />
+ <capture number="2" name="erlang.bracket" />
+ </starts-with>
+ <ends-with>
+ <expression>(\})</expression>
+ <capture number="1" name="erlang.bracket" />
+ </ends-with>
+ <subscopes>
+ <scope name="erlang.internal.map.field">
+ <expression>(=&gt;)|(:=)</expression>
+ <capture number="1" name="erlang.operator.map.association" />
+ <capture number="2" name="erlang.operator.map.exact" />
+ </scope>
+ <include syntax="self" collection="everything-else" />
+ </subscopes>
+ </scope>
+ </collection>
+
<collection name="tuple">
<scope name="erlang.internal.tuple">
<starts-with>
@@ -625,7 +648,7 @@
<capture number="1" name="erlang.bracket" />
</ends-with>
<subscopes>
- <scope name="erlang.internal.separtor.list">
+ <scope name="erlang.operator">
<expression>\|\||\||,</expression>
</scope>
<include syntax="self" collection="everything-else" />
diff --git a/test/10-record-usage.erl b/test/10-record-usage.erl
index 536a577..11aef27 100644
--- a/test/10-record-usage.erl
+++ b/test/10-record-usage.erl
@@ -12,3 +12,6 @@ bar(#acc{} = Acc) ->
thing = 2,
blue = Acc
}.
+
+baz(#acc{} = Acc) ->
+ Acc#acc.count.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment