diff --git a/templates/srecode-matlab.srt b/templates/srecode-matlab.srt new file mode 100644 index 0000000..c8dc0b4 --- /dev/null +++ b/templates/srecode-matlab.srt @@ -0,0 +1,112 @@ +;; srecode-matlab.srt --- SREcode Templates for MATLAB. + +;; Copyright (C) 2008 Eric Ludlam + +;; Author: Eric Ludlam +;; X-RCS: $Id$ + +;; 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, 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; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + + +set mode "matlab-mode" +set escape_start "{{" +set escape_end "}}" + +context file + +set comment_start "%" +set comment_prefix "%" +set comment_end "" + +;; @todo - add argument support. +;; choose template based on script/function or class in current dir. +template empty :file :user :time +"Fill out an empty file." +---- +function {{FILE}} +% {{FILE:upcase}} - + +{{comment_prefix}} Copyright (C) {{YEAR}} {{?AUTHOR}} + +{{^}} + +end +---- +bind "e" + + +context declaration + + +prompt NAME "Name for declaration: " + +template classdef :time +"Template to declare a class" +---- +classdef {{?NAME}} +% Class {{NAME}} +% +% Copyright (C) {{YEAR}} {{?AUTHOR}} + + properties + + end + + methods + function h = {{NAME}}(varargin) + {{^}} + end + end +end +---- +bind "c" + +template function :blank :indent +"Template to declare a function." +---- +function {{?NAME}} + {{^}} +end +---- +bind "f" + +template variable :blank :indent +"Template to declare a variable." +---- +global {{?NAME}} +---- +bind "v" + +context code + +template function :blank :indent +"Nested functions are indented." +---- + function {{?NAME}} + {{^}} + end +---- +bind "f" + +template variable :blank :indent +"Template to declare a variable." +---- + persistent {{?NAME}} +---- +bind "v" + + +;; end \ No newline at end of file