Permalink
Browse files

Update syntax

  • Loading branch information...
1 parent 715ae55 commit a66bba0f8a0187c98e874f21e742316ac0a8c838 @josevalim josevalim committed May 13, 2012
Showing with 22 additions and 44 deletions.
  1. +2 −23 Preferences/Indent.tmPreferences
  2. +16 −0 Snippets/moduledoc.tmSnippet
  3. +3 −21 Syntaxes/Elixir.tmLanguage
  4. +1 −0 info.plist
@@ -9,30 +9,9 @@
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
- <string>^\s*([}\]]\s*$|(end|after|else|elsif|match)\b)</string>
+ <string>^\s*((\}|\]|after|else|catch|rescue)\s*$|end\b)</string>
<key>increaseIndentPattern</key>
- <string>(?x)^
- (\s*
- (else|elsif
- |match|after
- |(?= .*? \b((do|\-\&gt;)([^:]|$))\b )
- # the look-ahead above is to quickly discard non-candidates
- ( "(\\.|[^\\"])*+" # eat a double quoted string
- | '(\\.|[^\\'])*+' # eat a single quoted string
- | [^#"'] # eat all but comments and strings
- )*
- ( \s (do|\-\&gt;)
- )
- )\b
- (?! [^;]*+ ; .*? \bend\b )
- |( "(\\.|[^\\"])*+" # eat a double quoted string
- | '(\\.|[^\\'])*+' # eat a single quoted string
- | [^#"'] # eat all but comments and strings
- )*
- ( \{ (?! [^}]*+ \} )
- | \[ (?! [^\]]*+ \] )
- )
- ).*$</string>
+ <string>(after|else|catch|rescue|\-\&gt;|\{|\[|do)\s*$</string>
</dict>
<key>uuid</key>
<string>313112A0-FC40-4025-97AE-3E85DC0DB08F</string>
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>content</key>
+ <string>@moduledoc """
+$0
+"""</string>
+ <key>name</key>
+ <string>moduledoc</string>
+ <key>tabTrigger</key>
+ <string>mdoc</string>
+ <key>uuid</key>
+ <string>F0413B1A-CDD9-4425-BA63-09BE5CF37CBC</string>
+</dict>
+</plist>
@@ -12,19 +12,9 @@
<key>firstLineMatch</key>
<string>^#!/.*\belixir</string>
<key>foldingStartMarker</key>
- <string>(?x)^
- (\s*+
- ((do|\-\&gt;)(?!.*\bend\s*$)
- ).*$
- | [#] .*? \(fold\) \s*+ $ # Sune’s special marker
- </string>
+ <string>(after|else|catch|rescue|\-\&gt;|\{|\[|do)\s*$</string>
<key>foldingStopMarker</key>
- <string>(?x)
- ( (^|;) \s*+ end \s*+ ([#].*)? $
- | (^|;) \s*+ end \. .* $
- | ^ \s*+ [}\]] ,? \s*+ ([#].*)? $
- | [#] .*? \(end\) \s*+ $ # Sune’s special marker
- )</string>
+ <string>^\s*((\}|\]|after|else|catch|rescue)\s*$|end\b)</string>
<key>keyEquivalent</key>
<string>^~E</string>
<key>name</key>
@@ -112,20 +102,12 @@
</dict>
<dict>
<key>match</key>
- <string>(?&lt;!\.)\b(case|end|bc|lc|if|unless|try|loop|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate|defexception|exit|raise|throw)\b(?![?!])</string>
+ <string>(?&lt;!\.)\b(do|end|case|bc|lc|if|cond|unless|try|loop|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate|defexception|exit|after|rescue|catch|else|raise|throw)\b(?![?!])</string>
<key>name</key>
<string>keyword.control.elixir</string>
</dict>
<dict>
<key>comment</key>
- <string>contextual smart pair support for block parameters</string>
- <key>match</key>
- <string>(?&lt;!\.)\b(do|\-\&gt;)\b\s*</string>
- <key>name</key>
- <string>keyword.control.start-block.elixir</string>
- </dict>
- <dict>
- <key>comment</key>
<string> as above, just doesn't need a 'end' and does a logic operation</string>
<key>match</key>
<string>(?&lt;!\.)\b(and|not|or|when|xor|in)\b</string>
View
@@ -16,6 +16,7 @@
<string>1BAFD05F-558D-4B18-95BF-7399E84A8E39</string>
<string>22297559-5C12-4EDC-913B-423C1E1740D8</string>
<string>79481DC6-D14E-4FFD-B4AC-1680139047B3</string>
+ <string>F0413B1A-CDD9-4425-BA63-09BE5CF37CBC</string>
</array>
<key>uuid</key>
<string>E65BAFA0-39BA-458F-8D85-ECE6BF9EDF69</string>

0 comments on commit a66bba0

Please sign in to comment.