Skip to content

Commit

Permalink
Improve matching of types/specs.
Browse files Browse the repository at this point in the history
- The parentheses after some directives, e.g. the -spec directive can be omitted, however the directive would then be highlighted as an atom.

``` erlang
-spec(foo() -> { ok, bar }).  % spec is highlighted
-spec foo() -> { ok, bar }.   % spec is not highlighted, though it is perfectly valid
```
- Defining record types, the `::` operator was not recognized, and types were only recognized, if defaults were set:

``` erlang
-record({
  foo = default :: atom()  % atom() is highlighted as a function/type
  bar :: atom()            % atom() is not highlighted
})
```
  • Loading branch information
squidfunk authored and infininight committed Jan 14, 2013
1 parent 25cf0ba commit 82188ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Syntaxes/Erlang.plist
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@
<array> <array>
<dict> <dict>
<key>begin</key> <key>begin</key>
<string>^\s*+(-)\s*+([a-z][a-zA-Z\d@_]*+)\s*+(\()</string> <string>^\s*+(-)\s*+([a-z][a-zA-Z\d@_]*+)\s*+(\(?)</string>
<key>beginCaptures</key> <key>beginCaptures</key>
<dict> <dict>
<key>1</key> <key>1</key>
Expand All @@ -444,7 +444,7 @@
</dict> </dict>
</dict> </dict>
<key>end</key> <key>end</key>
<string>(\))\s*+(\.)</string> <string>(\)?)\s*+(\.)</string>
<key>endCaptures</key> <key>endCaptures</key>
<dict> <dict>
<key>1</key> <key>1</key>
Expand Down Expand Up @@ -1332,7 +1332,7 @@
<array> <array>
<dict> <dict>
<key>begin</key> <key>begin</key>
<string>(([a-z][a-zA-Z\d@_]*+|'[^']*+')|(_))\s*+(=)</string> <string>(([a-z][a-zA-Z\d@_]*+|'[^']*+')|(_))\s*+(=|::)</string>
<key>beginCaptures</key> <key>beginCaptures</key>
<dict> <dict>
<key>2</key> <key>2</key>
Expand Down Expand Up @@ -2501,7 +2501,7 @@
<key>symbolic-operator</key> <key>symbolic-operator</key>
<dict> <dict>
<key>match</key> <key>match</key>
<string>\+\+|\+|--|-|\*|/=|/|=/=|=:=|==|=&lt;|=|&lt;-|&lt;|&gt;=|&gt;|!</string> <string>\+\+|\+|--|-|\*|/=|/|=/=|=:=|==|=&lt;|=|&lt;-|&lt;|&gt;=|&gt;|!|::</string>
<key>name</key> <key>name</key>
<string>keyword.operator.symbolic.erlang</string> <string>keyword.operator.symbolic.erlang</string>
</dict> </dict>
Expand Down

0 comments on commit 82188ba

Please sign in to comment.