Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

merged in work by Thomas Kjosmoen (apologies for the large commit)

git-svn-id: http://svn.textmate.org/trunk/Bundles/Matlab.tmbundle@10774 dfb7d73b-c2ec-0310-8fea-fb051d288c6d
  • Loading branch information...
commit 412c5eefaf742e371e24b2aa0e8bf0eee1eeeaeb 1 parent cc22537
@mattfoster mattfoster authored
Showing with 2,733 additions and 375 deletions.
  1. +92 −0 Commands/Create table.tmCommand
  2. +40 −0 Commands/Enter in Double Comment.tmCommand
  3. +40 −0 Commands/Enter in Incomplete Variable Assignment.tmCommand
  4. +28 −0 Commands/Function documentation.tmCommand
  5. +33 −0 Commands/Insert header comment.tmCommand
  6. +31 −0 Commands/Insert section division.tmCommand
  7. +1 −1  Commands/Replace comments with default.tmCommand
  8. +1 −1  Commands/Toggle comment style.tmCommand
  9. +27 −0 Commands/clear.tmCommand
  10. +55 −0 Commands/enter in brackets or parens.tmCommand
  11. +44 −0 Commands/enter in string in brackets.tmCommand
  12. +121 −0 Commands/enter in string.tmCommand
  13. +37 −0 Commands/num2str.tmCommand
  14. +27 −0 Commands/save.tmCommand
  15. +2 −2 Commands/subplot.tmCommand
  16. +1 −1  DragCommands/load mat file.tmDragCommand
  17. +2 −2 DragCommands/read image.tmDragCommand
  18. +52 −0 Macros/Jump to incomplete assignments.tmMacro
  19. +43 −1 Preferences/Indent.tmPreferences
  20. +62 −0 Preferences/Miscellaneous Octave.tmPreferences
  21. +1 −1  Preferences/Preferences.tmPreferences
  22. +17 −0 README.md
  23. +42 −0 Snippets/BSD.tmSnippet
  24. +33 −0 Snippets/GPL.tmSnippet
  25. +16 −0 Snippets/^.tmSnippet
  26. +1 −1  Snippets/case.tmSnippet
  27. +1 −1  Snippets/clear.tmSnippet
  28. +15 −0 Snippets/comment divide.tmSnippet
  29. +2 −2 Snippets/disp sprintf.tmSnippet
  30. +1 −1  Snippets/disp.tmSnippet
  31. +1 −1  Snippets/dlmwrite.tmSnippet
  32. +17 −0 Snippets/else.tmSnippet
  33. +1 −1  Snippets/elseif.tmSnippet
  34. +1 −1  Snippets/error.tmSnippet
  35. +16 −0 Snippets/exp.tmSnippet
  36. +1 −1  Snippets/for.plist
  37. +2 −2 Snippets/fprintf.tmSnippet
  38. +1 −1  Snippets/function (fun).plist
  39. +2 −2 Snippets/get.tmSnippet
  40. +1 −1  Snippets/griddata.tmSnippet
  41. +1 −1  Snippets/if else.tmSnippet
  42. +23 −0 Snippets/if elseif.tmSnippet
  43. +1 −1  Snippets/if.plist
  44. +1 −1  Snippets/line.tmSnippet
  45. +1 −1  Snippets/nargchk.tmSnippet
  46. +4 −4 Snippets/revisions.tmSnippet
  47. +2 −2 Snippets/set.tmSnippet
  48. +18 −0 Snippets/small function.tmSnippet
  49. +2 −2 Snippets/sprintf.tmSnippet
  50. +21 −0 Snippets/switch___case___otherwise___end.tmSnippet
  51. +3 −3 Snippets/title.tmSnippet
  52. +2 −2 Snippets/unix.tmSnippet
  53. +2 −2 Snippets/warning.tmSnippet
  54. +6 −9 Snippets/while.tmSnippet
  55. +3 −3 Snippets/xlabel.tmSnippet
  56. +2 −2 Snippets/xtick.tmSnippet
  57. +3 −3 Snippets/ylabel.tmSnippet
  58. +2 −2 Snippets/ytick.tmSnippet
  59. +3 −3 Snippets/zlabel.tmSnippet
  60. +80 −0 Support/lib/MATLABUtils.rb
  61. +911 −289 Syntaxes/M.plist
  62. +657 −0 Syntaxes/Octave.tmLanguage
  63. +74 −21 info.plist
View
92 Commands/Create table.tmCommand
@@ -0,0 +1,92 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+if ENV.has_key?('TM_SELECTED_TEXT') then
+ result = ENV['TM_SELECTED_TEXT'].strip
+ case result
+ when /'.*'/
+ @pad = "' '"
+ else
+ @pad = "0"
+ end
+ @input_table = result.to_a.collect {|row| row.chomp.split(/\s+|,/)}
+ rows = @input_table.length
+ columns = @input_table.inject { |memo, row| memo.length &gt; row.length ? memo : row }.length
+else
+ result=`"$TM_SUPPORT_PATH/bin"/CocoaDialog.app/Contents/MacOS/CocoaDialog standard-inputbox \
+ --title 'Matlab Array Creation' \
+ --informative-text 'Number of rows and columns:' \
+ --text '6 4'`.split
+ exit if result[0] == "2" || result.length == 1
+ @input_table = nil
+ result.collect! { |num| num.to_i}
+ result[2] = result[1] if result.length == 2
+ # We'll only create up to two-dimensional arrays
+ # with up to N elements
+ N = 200
+ product = result[1..2].inject(1) {|product, num| product * num }
+ if product.zero?
+ # give error message
+ exit
+ elsif product &gt; N
+ open('|"$DIALOG" tooltip', 'w') do |io|
+ io &lt;&lt; "The matrix dimensions are too large.\nThe maximum is set to #{N} elements."
+ end
+ exit
+ else
+ rows, columns = result[1..2]
+ end
+end
+
+@pos = 0
+def self.insert(row,column)
+ if @input_table.nil?
+ @pos += 1
+ "${#{@pos}:#{@pos}}"
+ else
+ ret = @input_table[row][column]
+ if ret.nil?
+ @pos += 1
+ "${#{@pos}:#{@pad}}"
+ else
+ ret
+ end
+ end
+end
+
+table = ""
+table += "[" if rows &gt; 1
+rows.times do |m|
+ table += "["
+ columns.times do |n|
+ table += insert(m,n)
+ table += (n == columns-1) ? "]" : "\t"
+ end
+ table += ";\n" unless (m == rows-1)
+end
+table += "]" if rows &gt; 1
+table += "${#{@pos+1}:;}\n$0"
+puts table
+</string>
+ <key>fallbackInput</key>
+ <string>none</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^@T</string>
+ <key>name</key>
+ <string>Create matrix</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>uuid</key>
+ <string>F23DAE9B-A27A-41D3-B57B-DED30729243C</string>
+</dict>
+</plist>
View
40 Commands/Enter in Double Comment.tmCommand
@@ -0,0 +1,40 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+thisline = ENV['TM_CURRENT_LINE']
+soft_tabs = ENV['TM_SOFT_TABS']
+tab_size = ENV['TM_TAB_SIZE'].to_i
+# thisline = "asdfasd f % asdfasdfadsfasd"
+# thisline = "aasdfasd ff % asdfasdfadsfasd"
+# thisline = "aasdfasd fff % asdfasdfadsfasd"
+spaces = thisline.match(/^(.*?)(%%|%|#)(\s*).*$/)
+
+leading_spaces = spaces.captures[0].gsub(/[^\t]{4}/,"\t").gsub(/[^\t]{1,3}\t/,"\t")
+
+if spaces.captures[0] =~ /\S/
+ leading_spaces.gsub!(/\t/,"".ljust(tab_size)) if ENV['TM_SOFT_TABS'] == "YES"
+else
+ leading_spaces = ""
+end
+
+print "\n#{leading_spaces}#{spaces.captures[1] + spaces.captures[2]}$1"
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>keyEquivalent</key>
+ <string></string>
+ <key>name</key>
+ <string>Enter in Comment</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>comment.line.percentage.matlab, comment.double.percentage.matlab, comment.line.percentage.octave, comment.double.percentage.octave, comment.line.pound.octave</string>
+ <key>uuid</key>
+ <string>615CF7DB-FDB1-4013-9725-FDF4BE64E8A4</string>
+</dict>
+</plist>
View
40 Commands/Enter in Incomplete Variable Assignment.tmCommand
@@ -0,0 +1,40 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+lineindex = ENV['TM_LINE_INDEX'].to_i
+thisline = ENV['TM_CURRENT_LINE']
+scopes = ENV['TM_SCOPE'].split
+
+firsthalf = thisline.slice(0...lineindex)
+secondhalf = thisline.slice(lineindex..-1)
+
+if scopes[0] == "source.matlab"
+ firsthalf.sub!(/\s*\.*\s*$/," ...")
+elsif scopes[0] == "source.octave"
+ firsthalf.sub!(/\s*(\.*|\\)\s*$/," ...")
+end
+firsthalf += "\n"
+print firsthalf, '$1', secondhalf
+
+</string>
+ <key>fallbackInput</key>
+ <string>line</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>
+</string>
+ <key>name</key>
+ <string>Enter in Incomplete Variable Assignment</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.matlab invalid.illegal.incomplete-variable-assignment.matlab, source.octave invalid.illegal.incomplete-variable-assignment.matlab</string>
+ <key>uuid</key>
+ <string>FD9512A7-561A-4140-A425-567B8D2862EA</string>
+</dict>
View
28 Commands/Function documentation.tmCommand
@@ -0,0 +1,28 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>if grep &lt;&lt;&lt;${TM_CURRENT_WORD:-!} -Esq '[a-zA-Z0-9_]+'
+ then exit_show_html "&lt;meta http-equiv='Refresh' content='0;URL=http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/${TM_CURRENT_WORD}.html'&gt;"
+ else echo "Nothing to lookup (hint: place the caret on a function name)"
+fi
+</string>
+ <key>fallbackInput</key>
+ <string>word</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^h</string>
+ <key>name</key>
+ <string>Function Documentation</string>
+ <key>output</key>
+ <string>showAsHTML</string>
+ <key>scope</key>
+ <string>source.matlab</string>
+ <key>uuid</key>
+ <string>033730AF-96F5-4F0C-9199-E0683D40A22C</string>
+</dict>
+</plist>
View
33 Commands/Insert header comment.tmCommand
@@ -0,0 +1,33 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+width = 80
+
+topbottom = "%%".ljust(width,"=") + "\n"
+
+print topbottom
+print "%%${1/^" + "(.)?"*(width-2) + ".*$/"
+1.upto(width-2) { |i| print "(?#{i}:: )" }
+print "/}${1:Header}" + "\n"
+print topbottom
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>name</key>
+ <string>Insert header comment</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>head</string>
+ <key>uuid</key>
+ <string>AD7201FB-23AD-4105-B8E3-5AAD29419FA6</string>
+</dict>
+</plist>
View
31 Commands/Insert section division.tmCommand
@@ -0,0 +1,31 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+width = 80
+buffer = 5
+
+print "%%${1/^" + "(.)?"*(width) + ".*$/"
+1.upto(width-2-buffer) { |i| print "(?#{i}::=)" }
+print "/}".ljust(buffer+2)
+print "${1:Header}" + "\n$0"
+</string>
+ <key>input</key>
+ <string>none</string>
+ <key>name</key>
+ <string>Insert section division</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>div</string>
+ <key>uuid</key>
+ <string>D21BACE2-24A1-43EF-854C-460F5A55694E</string>
+</dict>
+</plist>
View
2  Commands/Replace comments with default.tmCommand
@@ -29,7 +29,7 @@ end
<key>output</key>
<string>replaceDocument</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>uuid</key>
<string>321567FE-2E57-4D5C-BEFB-98FE869FF4D7</string>
</dict>
View
2  Commands/Toggle comment style.tmCommand
@@ -25,7 +25,7 @@ end
<key>output</key>
<string>replaceSelectedText</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>uuid</key>
<string>BEAE3101-B710-4BDE-A178-247F9FB6C018</string>
</dict>
View
27 Commands/clear.tmCommand
@@ -0,0 +1,27 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+require ENV["TM_BUNDLE_SUPPORT"] + "/lib/MATLABUtils.rb"
+include MATLAB
+variables = MATLAB.get_variables
+puts "clear('${1:#{variables.join("','")}}'$2);"
+</string>
+ <key>input</key>
+ <string>document</string>
+ <key>name</key>
+ <string>clear</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>cl</string>
+ <key>uuid</key>
+ <string>31D0DE27-0382-4F5F-B005-351F9D9B4589</string>
+</dict>
+</plist>
View
55 Commands/enter in brackets or parens.tmCommand
@@ -0,0 +1,55 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+textarray = STDIN.readlines
+currentline = ENV['TM_LINE_NUMBER'].to_i
+numlines = textarray.size.to_i
+lineindex = ENV['TM_LINE_INDEX'].to_i
+thisline = ENV['TM_CURRENT_LINE']
+columns = ENV['TM_LINE_INDEX'].to_i
+
+
+if (textarray.size == currentline) &amp;&amp; (textarray.last.length == lineindex)
+ # We're at the very end.
+ if thisline.slice(0...lineindex).slice(/(\)|\])$/)
+ # We're outside closed brackets/parens. Just insert an enter
+ print "\n"
+ else
+ print " ...\n"
+ end
+else
+ # Let's add some dots. If we already have a dot or two, we won't print all three dots
+ dots = thisline.slice(0...lineindex).slice(/\.+$/).to_s.length
+ case dots
+ when 0
+ print " ..."
+ when 1
+ print ".."
+ when 2
+ print "."
+ end
+ print "\n"
+end
+</string>
+ <key>fallbackInput</key>
+ <string>scope</string>
+ <key>input</key>
+ <string>document</string>
+ <key>keyEquivalent</key>
+ <string>
+</string>
+ <key>name</key>
+ <string>Enter in Brackets or Parens Scope</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>(meta.brackets.matlab|meta.brackets.octave) - string.quoted.single.matlab,(meta.parens.matlab|meta.parens.octave) - string.quoted.single.matlab,(meta.brackets.curly.matlab|meta.brackets.curly.octave) - string.quoted.single.matlab</string>
+ <key>uuid</key>
+ <string>8A857EDA-B07B-4304-BA10-29C3D22A3B1B</string>
+</dict>
View
44 Commands/enter in string in brackets.tmCommand
@@ -0,0 +1,44 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+textarray = STDIN.readlines
+currentline = ENV['TM_LINE_NUMBER'].to_i
+numlines = textarray.size.to_i
+lineindex = ENV['TM_LINE_INDEX'].to_i
+thisline = ENV['TM_CURRENT_LINE']
+columns = ENV['TM_LINE_INDEX'].to_i
+if columns == 0 &amp;&amp; thisline[0] == ?'
+ print "...\n"
+else
+ if thisline.slice(0...lineindex).slice(/\'+$/).to_s.length.modulo(2) == 0
+ # We must insert a quote
+ print "'"
+ end
+ if (textarray.size == currentline) &amp;&amp; (textarray.last.length == lineindex)
+ # We're at the very end. If the last character is a quotation mark
+ # we'll not add a leading quote.
+ print " ...\n'$1']"
+ else
+ print " ...\n'"
+ end
+end</string>
+ <key>input</key>
+ <string>document</string>
+ <key>keyEquivalent</key>
+ <string>
+</string>
+ <key>name</key>
+ <string>Enter in String in Brackets Scope</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>meta.brackets.matlab string.quoted.single.matlab</string>
+ <key>uuid</key>
+ <string>732F1DA4-166B-44AF-88CD-5A944574D3CC</string>
+</dict>
View
121 Commands/enter in string.tmCommand
@@ -0,0 +1,121 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+
+# Due to many special cases, this is rather ugly.
+
+# Set up all parameters
+debug = false
+textarray = STDIN.readlines
+linenumber = ENV['TM_LINE_NUMBER'].to_i
+numlines = textarray.size
+# Adjust for missing empty last line if last character is a newline
+numlines += 1 if textarray.last[-1] == 10
+lineindex = ENV['TM_LINE_INDEX'].to_i
+scopes = ENV['TM_SCOPE'].split
+preceding_string = scopes.index("punctuation.definition.string.begin.matlab")
+escaped_quote = scopes.index("constant.character.escape.matlab")
+if debug
+ print "preceding_string", "\t\t= ___", preceding_string, "___\n"
+ print "escaped_quote", "\t\t= ___", escaped_quote, "___\n"
+end
+
+thisline = ENV['TM_CURRENT_LINE']
+firsthalf = thisline.slice(0...lineindex).gsub(/\$/,"\\\$")
+secondhalf = thisline.slice(lineindex...thisline.length).gsub(/\$/,"\\\$")
+
+atEOL = (thisline.length == lineindex)
+atEOF = (atEOL &amp;&amp; numlines == linenumber)
+firstmatch = firsthalf.match(/(')(('{2}|[^'])*)(')?$/)
+secondmatch = secondhalf.match(/(')?(('{2}|[^'])*)(')?/)
+
+if atEOF
+ if firstmatch.nil?
+ puts "we have no quotes on this line" if debug
+ # insert closing quote on preceding line and an enter
+ elsif firstmatch.captures.last == "'"
+ puts "we have a closing quote. insert enter" if debug
+ firsthalf += "\n"
+ else
+ puts "we must close the string and insert an enter" if debug
+ firsthalf += "'\n"
+ end
+else
+ if preceding_string
+ puts "we're preceding a string. insert dots and an enter" if debug
+ # check for =-+/*
+ firsthalf += " ..." unless firsthalf.match(/[\=\+\-\*\/]\s*$/).nil?
+ firsthalf += "\n"
+ elsif atEOL
+ puts "we're at the end of the line. insert a quote and an enter" if debug
+ firsthalf += "'" if secondmatch.captures.first.nil? &amp;&amp; secondmatch.captures.last.nil? &amp;&amp; firstmatch.captures.last.nil?
+ firsthalf += "\n"
+ else
+ # check if firsthalf is a closed string
+ firsthalf.insert(firstmatch.begin(0),"[")
+ if firstmatch.captures.last == "'"
+ puts "first half is a closed string. insert brackets and dots" if debug
+ else
+ puts "first half is not closed. insert brackets, closing quote, and dots" if debug
+ firsthalf += "'"
+ end
+ firsthalf += " ...\n"
+
+ if secondmatch.captures.first.nil?
+ puts "second half has no opening quote. insert leading quote and closing bracket" if debug
+ secondhalf = "'" + secondhalf
+ end
+ if secondmatch.captures.last.nil?
+ puts "second half has no closing quote. insert ending quote" if debug
+ secondhalf += "']"
+ else
+ puts "second half has no closing bracket. insert ending bracket" if debug
+ bias = secondmatch.captures.first.nil? ? 1 : 0 # compensate index for added quote
+ secondhalf.insert(secondmatch.end(0) + bias,"]")
+ end
+ end
+end
+
+if debug
+ print "linenumber", "\t= ___", linenumber, "___\n"
+ print "numlines", "\t= ___", numlines, "___\n"
+ print "lineindex", "\t= ___", lineindex, "___\n"
+ print "firsthalf", "\t= ___", firsthalf, "___\n"
+ print "secondhalf", "\t= ___", secondhalf, "___\n"
+ print "scopes", "\t\t= ___", scopes, "___\n"
+ print "preceding_string", "\t\t= ___", preceding_string, "___\n"
+ print "escaped_quote", "\t\t= ___", escaped_quote, "___\n"
+ print "atEOL", "\t\t= ___", atEOL, "___\n"
+ print "atEOF", "\t\t= ___", atEOF, "___\n"
+ print "debug", "\t\t= ___", debug, "___\n"
+ print "firstmatch", "\t= ___", firstmatch, "___\n"
+ print "firstmatch.begin(0)", "\t= ___", firstmatch.begin(0), "___\n"
+ print "secondmatch", "\t= ___", secondmatch, "___\n"
+ print "secondmatch.end(3)", "\t= ___", firstmatch.begin(3), "___\n"
+ print "firstmatch.captures\t\t", firstmatch.captures.inspect, "\n"
+ print "secondmatch.captures\t", secondmatch.captures.inspect, "\n"
+end
+
+print firsthalf, '$1', secondhalf
+</string>
+ <key>fallbackInput</key>
+ <string>line</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>
+</string>
+ <key>name</key>
+ <string>Enter in String</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>string.quoted.single.matlab - meta.brackets.matlab, string.quoted.single.matlab - meta.parens.matlab</string>
+ <key>uuid</key>
+ <string>12A5489D-0A50-4420-A53D-FB0C6A2794CD</string>
+</dict>
View
37 Commands/num2str.tmCommand
@@ -0,0 +1,37 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+# Wrap the current word or selected text in num2str()
+# or insert " if there is no word
+
+seltext = ENV['TM_SELECTED_TEXT'].to_s
+curword = ENV['TM_CURRENT_WORD'].to_s
+
+if !seltext.empty?
+ print "num2str(", seltext, ")"
+elsif !curword.empty?
+ print "num2str(", curword, ")"
+else
+ print "\""
+end</string>
+ <key>fallbackInput</key>
+ <string>word</string>
+ <key>input</key>
+ <string>selection</string>
+ <key>keyEquivalent</key>
+ <string>^'</string>
+ <key>name</key>
+ <string>num2str</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>(source.matlab|source.octave) - (string.quoted.single.matlab | comment.line.percentage.matlab | comment.double.percentage.matlab)</string>
+ <key>uuid</key>
+ <string>6F519B71-2D99-455B-9E4A-F614FD9CA253</string>
+</dict>
+</plist>
View
27 Commands/save.tmCommand
@@ -0,0 +1,27 @@
+<?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>beforeRunningCommand</key>
+ <string>nop</string>
+ <key>command</key>
+ <string>#!/usr/bin/env ruby
+require ENV["TM_BUNDLE_SUPPORT"] + "/lib/MATLABUtils.rb"
+include MATLAB
+variables = MATLAB.get_variables
+puts "save(${1:'${2:filename}'},${3:'${4:#{variables.join("','")}}'}$5);"
+</string>
+ <key>input</key>
+ <string>document</string>
+ <key>name</key>
+ <string>save</string>
+ <key>output</key>
+ <string>insertAsSnippet</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>save</string>
+ <key>uuid</key>
+ <string>EA2AB0C2-A215-4503-930C-785CDF66F95B</string>
+</dict>
+</plist>
View
4 Commands/subplot.tmCommand
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
@@ -41,7 +41,7 @@ print "${3:", subthis, "})${4:, }$0"</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>sub</string>
<key>uuid</key>
View
2  DragCommands/load mat file.tmDragCommand
@@ -22,7 +22,7 @@ echo "\${1:variable} = load('${filename}');"</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>uuid</key>
<string>41EA6496-FA26-4F74-90B1-F316A4C451AE</string>
</dict>
View
4 DragCommands/read image.tmDragCommand
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
@@ -37,7 +37,7 @@ echo "\${1:image} = imread('${filename}');"</string>
<key>output</key>
<string>insertAsSnippet</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>uuid</key>
<string>9FF80E01-2981-4D11-8E87-872FCCD0304E</string>
</dict>
View
52 Macros/Jump to incomplete assignments.tmMacro
@@ -0,0 +1,52 @@
+<?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>commands</key>
+ <array>
+ <dict>
+ <key>command</key>
+ <string>moveToBeginningOfDocument:</string>
+ </dict>
+ <dict>
+ <key>argument</key>
+ <dict>
+ <key>action</key>
+ <string>findNext</string>
+ <key>findInProjectIgnoreCase</key>
+ <true/>
+ <key>findString</key>
+ <string>^\s*(([a-zA-Z]\w*\s*=\s*(;|%))|(%\s*[a-zA-Z]\w*\s*=\s*?$))</string>
+ <key>ignoreCase</key>
+ <true/>
+ <key>regularExpression</key>
+ <true/>
+ <key>replaceAllScope</key>
+ <string>document</string>
+ <key>replaceString</key>
+ <string>mv "bilde.aspx?id=$2" "bilder/$2.jpg"</string>
+ <key>wrapAround</key>
+ <true/>
+ </dict>
+ <key>command</key>
+ <string>findWithOptions:</string>
+ </dict>
+ <dict>
+ <key>command</key>
+ <string>moveRight:</string>
+ </dict>
+ <dict>
+ <key>command</key>
+ <string>moveLeft:</string>
+ </dict>
+ </array>
+ <key>keyEquivalent</key>
+ <string>^ </string>
+ <key>name</key>
+ <string>Jump to incomplete assignments</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>uuid</key>
+ <string>459DF644-53A3-4ADD-8984-D4412CF44279</string>
+</dict>
+</plist>
View
44 Preferences/Indent.tmPreferences
@@ -3,13 +3,32 @@
<plist version="1.0">
<dict>
<key>name</key>
- <string>Indent</string>
+ <string>Miscellaneous Matlab</string>
<key>scope</key>
<string>source.matlab</string>
<key>settings</key>
<dict>
<key>decreaseIndentPattern</key>
<string>^\s*\b(end\w*|catch|else|elseif|case|otherwise)\b</string>
+ <key>highlightPairs</key>
+ <array>
+ <array>
+ <string>(</string>
+ <string>)</string>
+ </array>
+ <array>
+ <string>[</string>
+ <string>]</string>
+ </array>
+ <array>
+ <string>{</string>
+ <string>}</string>
+ </array>
+ <array>
+ <string>"</string>
+ <string>"</string>
+ </array>
+ </array>
<key>increaseIndentPattern</key>
<string>(?x)^\s*
\b(
@@ -20,6 +39,29 @@
|try|catch
|unwind_protect
)\b</string>
+ <key>smartTypingPairs</key>
+ <array>
+ <array>
+ <string>(</string>
+ <string>)</string>
+ </array>
+ <array>
+ <string>[</string>
+ <string>]</string>
+ </array>
+ <array>
+ <string>{</string>
+ <string>}</string>
+ </array>
+ <array>
+ <string>"</string>
+ <string>"</string>
+ </array>
+ <array>
+ <string>'</string>
+ <string>'</string>
+ </array>
+ </array>
</dict>
<key>uuid</key>
<string>2CD1353B-AEC7-4BBF-8061-6038D1E93FA8</string>
View
62 Preferences/Miscellaneous Octave.tmPreferences
@@ -0,0 +1,62 @@
+<?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>name</key>
+ <string>Miscellaneous Octave</string>
+ <key>scope</key>
+ <string>source.octave</string>
+ <key>settings</key>
+ <dict>
+ <key>decreaseIndentPattern</key>
+ <string>^\s*(catch|else|elseif|end|endfunction|endif|endswitch|endwhile|endfor|endtry)\b</string>
+ <key>highlightPairs</key>
+ <array>
+ <array>
+ <string>(</string>
+ <string>)</string>
+ </array>
+ <array>
+ <string>[</string>
+ <string>]</string>
+ </array>
+ <array>
+ <string>{</string>
+ <string>}</string>
+ </array>
+ <array>
+ <string>"</string>
+ <string>"</string>
+ </array>
+ </array>
+ <key>increaseIndentPattern</key>
+ <string>^\s*(catch|else|elseif|for|function|if|switch|while|try).*</string>
+ <key>shellVariables</key>
+ <array>
+ <dict>
+ <key>name</key>
+ <string>TM_COMMENT_START</string>
+ <key>value</key>
+ <string>% </string>
+ </dict>
+ </array>
+ <key>smartTypingPairs</key>
+ <array>
+ <array>
+ <string>(</string>
+ <string>)</string>
+ </array>
+ <array>
+ <string>[</string>
+ <string>]</string>
+ </array>
+ <array>
+ <string>{</string>
+ <string>}</string>
+ </array>
+ </array>
+ </dict>
+ <key>uuid</key>
+ <string>DCAA0C20-AF0B-4E64-A947-43DA07B901A4</string>
+</dict>
+</plist>
View
2  Preferences/Preferences.tmPreferences
@@ -5,7 +5,7 @@
<key>name</key>
<string>Preferences</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>settings</key>
<dict>
<key>shellVariables</key>
View
17 README.md
@@ -0,0 +1,17 @@
+Matlab / Octave TextMate Bundle
+===============================
+
+This is the TextMate bundle for Matlab and Octave.
+
+Recent changes:
+---------------
+
+* Merged in bits from [projects.ux.uis.no](https://projects.ux.uis.no/repositories/show/textmate).
+Please fix/report any problems. This is currently only in GitHub, but a merge back to TextMate's svn is planned.
+* Changes to the menu structure.
+* Added functions to the symbols list.
+
+Still todo:
+-----------
+
+Contact [Thomas Kjosmoen](http://kjosmoen.org/about "Kjosmoen.org - About me") who I can't seem to get hold of.
View
42 Snippets/BSD.tmSnippet
@@ -0,0 +1,42 @@
+<?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>% `if [[ ${TM_FILENAME} != '' ]]; then echo -e "\n% ${TM_FILENAME}\n% ";fi`
+% Copyright (C) `date +%Y` ${TM_FULLNAME}`if [[ ${TM_ORGANIZATION_NAME} != '' ]]; then echo -e ", ${TM_ORGANIZATION_NAME}";fi`. `if [[ ${TM_EMAIL} != '' ]]; then echo -e "\n% ${TM_EMAIL}";fi``if [[ ${TM_URL} != '' ]]; then echo -e "\n% ${TM_URL}";fi`
+% All rights reserved.
+%
+% Redistribution and use in source and binary forms, with or without
+% modification, are permitted provided that the following conditions are met:
+% * Redistributions of source code must retain the above copyright
+% notice, this list of conditions and the following disclaimer.
+% * Redistributions in binary form must reproduce the above copyright
+% notice, this list of conditions and the following disclaimer in the
+% documentation and/or other materials provided with the distribution.
+% * Neither the name of the &lt;organization&gt; nor the
+% names of its contributors may be used to endorse or promote products
+% derived from this software without specific prior written permission.
+%
+% THIS SOFTWARE IS PROVIDED BY &lt;copyright holder&gt; ``AS IS'' AND ANY
+% EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+% WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+% DISCLAIMED. IN NO EVENT SHALL &lt;copyright holder&gt; BE LIABLE FOR ANY
+% DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+% (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+% LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+% ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+% (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+% SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+%
+</string>
+ <key>name</key>
+ <string>BSD</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>bsd</string>
+ <key>uuid</key>
+ <string>DE617B87-A492-4C94-81CB-38F491C4C9B3</string>
+</dict>
+</plist>
View
33 Snippets/GPL.tmSnippet
@@ -0,0 +1,33 @@
+<?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>% `if [[ ${TM_FILENAME} != '' ]]; then echo -e "\n% ${TM_FILENAME}\n% ";fi`
+% Copyright (C) `date +%Y` ${TM_FULLNAME}`if [[ ${TM_ORGANIZATION_NAME} != '' ]]; then echo -e ", ${TM_ORGANIZATION_NAME}";fi`. `if [[ ${TM_EMAIL} != '' ]]; then echo -e "\n% ${TM_EMAIL}";fi``if [[ ${TM_URL} != '' ]]; then echo -e "\n% ${TM_URL}";fi`
+%
+% This program is free software; you can redistribute it and/or
+% modify it under the terms of the GNU General Public License
+% as published by the Free Software Foundation; either version 2
+% of the License, or (at your option) any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program; if not, write to the Free Software
+% Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+%
+</string>
+ <key>name</key>
+ <string>GPL</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>gpl</string>
+ <key>uuid</key>
+ <string>2FA74452-3A9B-428E-9DE4-7C04DA978635</string>
+</dict>
+</plist>
View
16 Snippets/^.tmSnippet
@@ -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>^($1) $2</string>
+ <key>name</key>
+ <string>^</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>^</string>
+ <key>uuid</key>
+ <string>6B86576E-F8E3-4E3A-8083-CFE4C0DF9E42</string>
+</dict>
+</plist>
View
2  Snippets/case.tmSnippet
@@ -8,7 +8,7 @@
<key>name</key>
<string>case</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>case</string>
<key>uuid</key>
View
2  Snippets/clear.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>clear</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>clear</string>
<key>uuid</key>
View
15 Snippets/comment divide.tmSnippet
@@ -0,0 +1,15 @@
+<?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>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% $1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+</string>
+ <key>name</key>
+ <string>Comment Divide</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>uuid</key>
+ <string>0844D21C-383B-4106-8474-8F79589731C6</string>
+</dict>
+</plist>
View
4 Snippets/disp sprintf.tmSnippet
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!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>
@@ -7,7 +7,7 @@
<key>name</key>
<string>disp sprintf</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>dsp</string>
<key>uuid</key>
View
2  Snippets/disp.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>disp</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>disp</string>
<key>uuid</key>
View
2  Snippets/dlmwrite.tmSnippet
@@ -8,7 +8,7 @@ $0</string>
<key>name</key>
<string>dlmwrite</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>dlmwrite</string>
<key>uuid</key>
View
17 Snippets/else.tmSnippet
@@ -0,0 +1,17 @@
+<?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>else
+ ${1:body}</string>
+ <key>name</key>
+ <string>else</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>else</string>
+ <key>uuid</key>
+ <string>582075F1-DB3F-4280-9F46-B615F8EF4A86</string>
+</dict>
+</plist>
View
2  Snippets/elseif.tmSnippet
@@ -8,7 +8,7 @@
<key>name</key>
<string>elseif</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>elseif</string>
<key>uuid</key>
View
2  Snippets/error.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>error</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>error</string>
<key>uuid</key>
View
16 Snippets/exp.tmSnippet
@@ -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>exp($1) $2</string>
+ <key>name</key>
+ <string>exp</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>e</string>
+ <key>uuid</key>
+ <string>C00046EC-C7DC-4BC5-81CD-EBCB0F6FE8F7</string>
+</dict>
+</plist>
View
2  Snippets/for.plist
@@ -13,7 +13,7 @@ fi`</string>
<key>name</key>
<string>for … end</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>for</string>
<key>uuid</key>
View
4 Snippets/fprintf.tmSnippet
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!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>
@@ -7,7 +7,7 @@
<key>name</key>
<string>fprintf</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>fpr</string>
<key>uuid</key>
View
2  Snippets/function (fun).plist
@@ -25,7 +25,7 @@ fi`</string>
<key>name</key>
<string>function</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>fun</string>
<key>uuid</key>
View
4 Snippets/get.tmSnippet
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!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>
@@ -7,7 +7,7 @@
<key>name</key>
<string>get</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>get</string>
<key>uuid</key>
View
2  Snippets/griddata.tmSnippet
@@ -7,7 +7,7 @@
<key>name</key>
<string>griddata</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>griddata</string>
<key>uuid</key>
View
2  Snippets/if else.tmSnippet
@@ -15,7 +15,7 @@ fi`</string>
<key>name</key>
<string>if … else …end</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>ife</string>
<key>uuid</key>
View
23 Snippets/if elseif.tmSnippet
@@ -0,0 +1,23 @@
+<?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>if ${1:condition}
+ ${2:body}
+elseif ${3:condition}
+ ${4:body}
+else
+ ${5:body}
+end
+</string>
+ <key>name</key>
+ <string>if … elseif … end</string>
+ <key>scope</key>
+ <string>source.matlab , source.octave</string>
+ <key>tabTrigger</key>
+ <string>ifeif</string>
+ <key>uuid</key>
+ <string>93234216-9807-416E-8416-A130A05C2C1F</string>
+</dict>
+</plist>
View
2  Snippets/if.plist
@@ -13,7 +13,7 @@ fi`</string>
<key>name</key>
<string>if … end</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>if</string>
<key>uuid</key>
View
2  Snippets/line.tmSnippet
@@ -8,7 +8,7 @@
<key>name</key>
<string>line</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>line</string>
<key>uuid</key>
View
2  Snippets/nargchk.tmSnippet
@@ -10,7 +10,7 @@ fi` ));
<key>name</key>
<string>nargchk</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>nargchk</string>
<key>uuid</key>
View
8 Snippets/revisions.tmSnippet
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!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>% Rev. by $TM_FULLNAME on `date +%Y-%m-%d`: ${1:Short description}</string>
+ <string>% Rev. by ${TM_FULLNAME} on `date +%Y-%m-%d`: ${1:Short description}</string>
<key>name</key>
- <string>revisions</string>
+ <string>Revisions</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>rev</string>
<key>uuid</key>
View
4 Snippets/set.tmSnippet
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!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>
@@ -7,7 +7,7 @@
<key>name</key>
<string>set</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
<string>set</string>
<key>uuid</key>
View
18 Snippets/small function.tmSnippet
@@ -0,0 +1,18 @@
+<?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>%% ${1:functionname}: ${2:function description}
+function [${3:outputs}] = ${1}(${4:arg})
+${3/,?\s*([a-zA-Z]\w*)|,\s*/(?1:\t$1 = ;\n)/g}</string>
+ <key>name</key>
+ <string>small function</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>func</string>
+ <key>uuid</key>
+ <string>2376F2E2-E240-422F-B6E8-48B6AA20C9EE</string>
+</dict>
+</plist>
View
4 Snippets/sprintf.tmSnippet
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!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>
@@ -7,7 +7,7 @@
<key>name</key>
<string>sprintf</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>spr</string>
<key>uuid</key>
View
21 Snippets/switch___case___otherwise___end.tmSnippet
@@ -0,0 +1,21 @@
+<?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>switch ${1:switch_expression}
+ case ${2:case_expression}
+ ${3:body}
+ otherwise
+ ${4:body}
+end</string>
+ <key>name</key>
+ <string>switch ... case ... otherwise ... end</string>
+ <key>scope</key>
+ <string>source.matlab, source.octave</string>
+ <key>tabTrigger</key>
+ <string>switch</string>
+ <key>uuid</key>
+ <string>89BADD5A-72B8-4FE5-B082-499C7E7AB452</string>
+</dict>
+</plist>
View
6 Snippets/title.tmSnippet
@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>title(${1:'${2}'});</string>
+ <string>set(get(gca,'Title'),'String',${1:'${2}'});</string>
<key>name</key>
<string>title</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
- <string>title</string>
+ <string>zla</string>
<key>uuid</key>
<string>7298E093-E86F-4A60-ACFF-67580F24FD27</string>
</dict>
View
4 Snippets/unix.tmSnippet
@@ -7,9 +7,9 @@
<key>name</key>
<string>unix</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
- <string>unix</string>
+ <string>uni</string>
<key>uuid</key>
<string>F0A7C9BF-8FE2-4452-8EC9-F71881C7831F</string>
</dict>
View
4 Snippets/warning.tmSnippet
@@ -3,11 +3,11 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>warning('${1:Description}');</string>
+ <string>warning(['${1:Description}']);</string>
<key>name</key>
<string>warning</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab, source.octave</string>
<key>tabTrigger</key>
<string>war</string>
<key>uuid</key>
View
15 Snippets/while.tmSnippet
@@ -4,18 +4,15 @@
<dict>
<key>content</key>
<string>while ${1:condition}
- $0
-`if [[ $TM_USE_OCTAVE -ne '0' ]]
- then echo "endwhile"
-else
- echo "end"
-fi`</string>
+ ${2:body}
+end
+</string>
<key>name</key>
- <string>while … end</string>
+ <string>while</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
- <string>while</string>
+ <string>whi</string>
<key>uuid</key>
<string>ADE63DB1-7F3A-4EAC-A5A4-3A35A28FE8F0</string>
</dict>
View
6 Snippets/xlabel.tmSnippet
@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>xlabel(${1:'${2}'});</string>
+ <string>set(get(gca,'XLabel'),'String',${1:'${2}'});</string>
<key>name</key>
<string>xlabel</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
- <string>xlabel</string>
+ <string>xla</string>
<key>uuid</key>
<string>178F5EE1-2953-4FB2-8623-99A1C7D0772F</string>
</dict>
View
4 Snippets/xtick.tmSnippet
@@ -7,9 +7,9 @@
<key>name</key>
<string>xtick</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
- <string>xtick</string>
+ <string>xti</string>
<key>uuid</key>
<string>A93C4844-87F4-4136-9580-75B697D0CFD7</string>
</dict>
View
6 Snippets/ylabel.tmSnippet
@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>ylabel(${1:'${2}'});</string>
+ <string>set(get(gca,'YLabel'),'String',${1:'${2}'});</string>
<key>name</key>
<string>ylabel</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
- <string>ylabel</string>
+ <string>yla</string>
<key>uuid</key>
<string>1F4C6EA6-370C-45A9-96C5-36E69CC297E3</string>
</dict>
View
4 Snippets/ytick.tmSnippet
@@ -7,9 +7,9 @@
<key>name</key>
<string>ytick</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
- <string>ytick</string>
+ <string>yti</string>
<key>uuid</key>
<string>2FED97FA-0EB0-45E3-B92F-757903E79684</string>
</dict>
View
6 Snippets/zlabel.tmSnippet
@@ -3,13 +3,13 @@
<plist version="1.0">
<dict>
<key>content</key>
- <string>xlabel(${1:'${2}'});</string>
+ <string>set(get(gca,'ZLabel'),'String',${1:'${2}'});</string>
<key>name</key>
<string>zlabel</string>
<key>scope</key>
- <string>source.matlab</string>
+ <string>source.matlab , source.octave</string>
<key>tabTrigger</key>
- <string>zlabel</string>
+ <string>zla</string>
<key>uuid</key>
<string>3C12382B-FD63-4DD8-9198-02D25AF755FF</string>
</dict>
View
80 Support/lib/MATLABUtils.rb
@@ -0,0 +1,80 @@
+# The MATLAB module contains methods for parsing MATLAB scripts and functions
+require ENV["TM_SUPPORT_PATH"] + "/lib/exit_codes.rb"
+
+module MATLAB
+ ENV['TM_SCOPE'] =~ /source\.(\w+)/
+ OCTAVE = ($1 == 'octave')
+
+ class <<self
+
+ # Method for extracting all variable names
+ def get_variables
+
+ variables = Array.new()
+ text = STDIN.readlines.join
+ # Remove all comments
+ text.gsub!(/%\{.*%\}/,'')
+ text.gsub!(/%.*(?=\n)/,'')
+ text.gsub!(/#.*(?=\n)/,'') if OCTAVE
+
+ # Strip out all escaped quotes
+ text.gsub!("''",'')
+
+ # Strip out all strings
+ text.gsub!(/((\[|\(|\{|=|\s|;|:|,)|^)'[^']+'/,'\1_')
+
+ # Exchange all '...' for ''
+ text.gsub!(/\.{3,}\s*\n\s*/,'')
+
+ # Replace all ; with newlines, and split
+ text.gsub!(';',"\n")
+
+ # puts text.split("\n").inspect
+ # print ENV["TM_COMMENT_START"]
+ text.split("\n").each do |line|
+ # Only process line if the line isn't a comment or blank
+ unless line.empty?
+ # If we have a function declaration, grab all variables
+ if line =~ /^\s*function[\s=]/
+ line =~ /^\s*function\s*(((\[.*\])|([a-zA-Z]\w*))\s*=\s*)?[a-zA-Z]\w*\s*(\(\s*([\w,\s]+)\s*\))?/
+
+ unless ($6).nil?
+ variables.concat(($6).strip.split(/\s*,\s*/))
+ end
+ end
+ if line =~ /[^=]=[^=]/
+
+ # Strip out everything after assignment
+ line.gsub!(/([^=]=[^=]).*?/,'\1')
+
+ # Strip the leading and trailing whitespace
+ line.strip!
+
+ # Strip out all core keywords
+ line.gsub!(/^\s*(function|if|switch|while|for|try)\s+/,'')
+
+ # Strip out all cells
+ while line =~ /[\{\}]/
+ line.gsub!(/\{[^\{\}]*?\}/,'')
+ end
+ # Strip out parentheses
+ while line =~ /[\(\)]/
+ line.gsub!(/\([^\(\)]*?\)/,'')
+ end
+
+ # Strip out all equal signs and strip
+ line.gsub!(/\s*=.*$/,'')
+
+ # Strip out all brackets
+ line.tr!('[]','')
+
+ # Split and include in variables
+ variables.concat(line.split(/\s*,\s*|\s/))
+ end
+ end
+ end
+ return variables.sort.uniq
+ end
+
+ end
+end
View
1,200 Syntaxes/M.plist
@@ -3,9 +3,9 @@
<plist version="1.0">
<dict>
<key>foldingStartMarker</key>
- <string>^\s*(function|if|switch|while|for|try|unwind_protect)\b(?!.*\bend\b).*$</string>
+ <string>^\s*(function|if|switch|while|for|try)\b(?!.*\bend\b).*$</string>
<key>foldingStopMarker</key>
- <string>^\s*(end|endif|endwhile|endfor|endswitch|endfunction|end_try_catch|end_unwind_protect|return)\b.*$</string>
+ <string>^\s*(end|return)\b.*$</string>
<key>keyEquivalent</key>
<string>^~M</string>
<key>name</key>
@@ -13,549 +13,1171 @@
<key>patterns</key>
<array>
<dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.matlab</string>
+ </dict>
+ </dict>
<key>match</key>
- <string>\b(varargin|varargout)\b</string>
+ <string>(%%).*$\n?</string>
<key>name</key>
- <string>storage.modifier.matlab</string>
+ <string>comment.double.percentage.matlab</string>
</dict>
<dict>
- <key>match</key>
- <string>\b(case|otherwise)\b</string>
+ <key>begin</key>
+ <string>%\{</string>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.matlab</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>%\}\s*\n</string>
<key>name</key>
- <string>keyword.control.matlab</string>
+ <string>comment.block.percentage.matlab</string>
</dict>
<dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.matlab</string>
+ </dict>
+ </dict>
<key>match</key>
- <string>\b(inputname|get|findobj|allchild|dbstack|stop|waitbar)\b</string>
+ <string>(%).*$\n?</string>
<key>name</key>
- <string>keyword.other.matlab</string>
+ <string>comment.line.percentage.matlab</string>
</dict>
<dict>
<key>begin</key>
- <string>\({2}</string>
- <key>captures</key>
+ <string>(?x)
+(?=function\b) # borrowed from ruby bundle
+(?&lt;=^|\s)(function)\s+ # the function keyword
+(?&gt;\[(.*)\])?\t# match various different combination of output arguments
+((?&gt;[a-zA-Z_]\w*))?
+(?&gt;\s*=\s*)?
+((?&gt;[a-zA-Z_]\w*(?&gt;[?!]|=(?!&gt;))? )) # the function name
+(?=[ \t]*[^\s%|#]) # make sure arguments and not a comment follow
+\s*(\() # the opening parenthesis for arguments</string>
+ <key>beginCaptures</key>
<dict>
- <key>0</key>
+ <key>1</key>
<dict>
<key>name</key>
- <string>punctuation.section.scope.matlab</string>
+ <string>storage.type.matlab</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>variable.parameter.output.function.matlab</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>variable.parameter.output.function.matlab</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.function.matlab</string>
</dict>
</dict>
+ <key>contentName</key>
+ <string>variable.parameter.input.function.matlab</string>
<key>end</key>
- <string>\){2}</string>
- <key>name</key>
- <string>meta.scope.expression.matlab</string>
- <key>patterns</key>
- <array>
+ <string>\)</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
<dict>
- <key>include</key>
- <string>$self</string>
+ <key>name</key>
+ <string>punctuation.definition.parameters.matlab</string>
</dict>
- </array>
+ </dict>
+ <key>name</key>
+ <string>meta.function.with-arguments.matlab</string>
</dict>
<dict>
- <key>begin</key>
- <string>\[{2}</string>
<key>captures</key>
<dict>
- <key>0</key>
+ <key>1</key>
<dict>
<key>name</key>
- <string>punctuation.section.scope.matlab</string>
+ <string>storage.type.matlab</string>
+ </dict>
+ <key>2</key>
+ <dict>
+ <key>name</key>
+ <string>variable.parameter.output.function.matlab</string>
+ </dict>
+ <key>3</key>
+ <dict>
+ <key>name</key>
+ <string>variable.parameter.output.function.matlab</string>
+ </dict>
+ <key>4</key>
+ <dict>
+ <key>name</key>
+ <string>entity.name.function.matlab</string>
</dict>
</dict>
- <key>end</key>
- <string>\]{2}</string>
+ <key>match</key>
+ <string>(?x)
+(?=function\b) # borrowed from ruby bundle
+(?&lt;=^|\s)(function)\s+ # the function keyword
+(?&gt;\[(.*)\])? # match various different combination of output arguments
+((?&gt;[a-zA-Z_]\w*))?
+(?&gt;\s*=\s*)?
+((?&gt;[a-zA-Z_]\w*(?&gt;[?!]|=(?!&gt;))? )) # the function name</string>
<key>name</key>
- <string>meta.scope.logical-expression.matlab</string>
+ <string>meta.function.without-arguments.matlab</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#constants_override</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#brackets</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#curlybrackets</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#parens</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#string</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#transpose</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#double_quote</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#operators</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#all_matlab_keywords</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#number</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#variable</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#variable_invalid</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#not_equal_invalid</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#variable_assignment</string>
+ </dict>
+ </array>
+ <key>repository</key>
+ <dict>
+ <key>all_matlab_keywords</key>
+ <dict>
<key>patterns</key>
<array>
<dict>
- <key>comment</key>
- <string>do we want a special rule for ( expr )?</string>
- <key>match</key>
- <string>==|~=|!=|&amp;|~|!|\|</string>
- <key>name</key>
- <string>keyword.operator.logical.matlab</string>
+ <key>include</key>
+ <string>#matlab_keyword_control</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_keyword_operator</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_keyword_other</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_storage_type</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_storage_modifier</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_constant_language</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_variable_function</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_keyword_desktop</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_keyword_mathematics</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_keyword_analysis</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_storage_control</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_graphics</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_function</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_external</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_aerospace</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_bioinformatics</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_communications</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_control_systems</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_curve_fitting</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_data_acquisition</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_database</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_datafeed</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_design</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_excel_link</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_filder_design_hdl_coder</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_financial_derivatives</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_financial</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_fixed_income</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_fixed_point</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_fuzzy_logic</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_garch</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_genetic_algorithms</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_image_acquisition</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_image_processing</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_instrument_control</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_mapping</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_model_predictive_control</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_model_based_calibration</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_neural_network</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_opc</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_optimization</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_rf</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_robust_control</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_signal_processing</string>
</dict>
<dict>
<key>include</key>
- <string>$self</string>
+ <string>#matlab_support_toolbox_spline</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_statistics</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_symbolic_math</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_system_identification</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_virtual_reality</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#matlab_support_toolbox_wavelet</string>
</dict>
</array>
</dict>
+ <key>allofem</key>
+ <dict>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#parens</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#curlybrackets</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#end_in_parens</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#brackets</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#string</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#transpose</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#double_quote</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#all_matlab_keywords</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#variable</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#variable_invalid</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#number</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#operators</string>
+ </dict>
+ </array>
+ </dict>
+ <key>brackets</key>
<dict>
<key>begin</key>
- <string>\(</string>
- <key>captures</key>
+ <string>\[</string>
+ <key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
- <string>punctuation.section.scope.matlab</string>
+ <string>meta.brackets.matlab</string>
</dict>
</dict>
+ <key>contentName</key>
+ <string>meta.brackets.matlab</string>
<key>end</key>
- <string>\)</string>
- <key>name</key>
- <string>meta.scope.parens.matlab</string>
+ <string>\]</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>meta.brackets.matlab</string>
+ </dict>
+ </dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
- <string>$self</string>
+ <string>#allofem</string>
</dict>
</array>
</dict>
+ <key>constants_override</key>
+ <dict>
+ <key>comment</key>
+ <string>The user is trying to override MATLAB constants and functions.</string>
+ <key>match</key>
+ <string>(^|\;)\s*(i|j|inf|Inf|nan|NaN|eps|end)\s*=[^=]</string>
+ <key>name</key>
+ <string>meta.inappropriate.matlab</string>
+ </dict>
+ <key>curlybrackets</key>
<dict>
<key>begin</key>
- <string>(%\{)</string>
+ <string>\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
- <string>punctuation.definition.comment.begin.matlab</string>
+ <string>meta.brackets.curly.matlab</string>
</dict>
</dict>
+ <key>contentName</key>
+ <string>meta.brackets.curly.matlab</string>
<key>end</key>
- <string>(%\})</string>
+ <string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
- <string>punctuation.definition.comment.end.matlab</string>
+ <string>meta