Merge from emacs-23; up to 2010-06-03T22:16:02Z!dann@ics.uci.edu
[bpt/emacs.git] / etc / srecode / test.srt
CommitLineData
c05676c5
CY
1;; test.srt --- SRecode templates for testing
2
73b0cd50 3;; Copyright (C) 2008-2011 Free Software Foundation, Inc.
c05676c5
CY
4
5;; Author: Eric M. Ludlam <eric@siege-engine.com>
6
7;; This file is part of GNU Emacs.
8
9;; GNU Emacs is free software: you can redistribute it and/or modify
10;; it under the terms of the GNU General Public License as published by
11;; the Free Software Foundation, either version 3 of the License, or
12;; (at your option) any later version.
13
14;; GNU Emacs is distributed in the hope that it will be useful,
15;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17;; GNU General Public License for more details.
18
19;; You should have received a copy of the GNU General Public License
20;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
21
22set mode "srecode-template-mode"
23set escape_start "$"
24set escape_end "$"
25set application "tests"
26
27set UTESTVAR1 ".SRT VAR 1"
28;;
29;; These are for testing features of template files.
30;;
31context test
32
33template test :user
34----
35$! This is a comment in the template. $
36;; $AUTHOR$
37;; $AUTHOR:upcase$
38----
39
40template subs :blank
41----
42;; Before Loop
43$#LOOP$
44;; - loop stuff
45$/LOOP$
46;; After Loop
47----
48
49;; Before insertion
50;; After insertion
51
52template firstlast
53sectiondictionary "A"
54set MOOSE "FIRST"
55sectiondictionary "A"
56set MOOSE "MIDDLE"
57sectiondictionary "A"
58set MOOSE "LAST"
59----
60$#A$
61;; << -- $MOOSE$
62$#FIRST$;; I'm First$/FIRST$
63$#NOTFIRST$;; I'm Not First$/NOTFIRST$
64$#LAST$;; I'm Last$/LAST$
65$#NOTLAST$;; I'm Not Last$/NOTLAST$
66;; -- >>
67$/A$
68----
69
70
71template wrapsomething :region
72----
73;; Put this line in front:
74$REGIONTEXT$
75;; Put this line at the end:
76----
77
78template gapsomething :blank
79----
80### ALL ALONE ON A LINE ###
81----
82
83template inlinetext
84"Insert text that has no nelines"
85----
86 *In the middle*
87----
88
89template includable :blank
90----
91;; An includable $COMMENT$ we could use.
92;; $^$
93;; Text after a point inserter.
94----
95
96template wrapinclude-basic
97----
98$>WI1:includable$
99----
100
101template wrapinclude-around
102----
103$<WI1:includable$Intermediate Comments$/WI1$
104----
105
106template complex-subdict
107sectiondictionary "A"
108set MYVAR1 "cow"
109set MYVAR2 "dog"
110set CPLX "I have a " macro "MYVAR1" " and a " macro "MYVAR2" "."
111----
112;; $#A$$CPLX$$/A$
113----
114
115template wrap-new-template
116sectiondictionary "NEWTMP"
117set DOC "A nice doc string goes here."
118----
119$<NEWTMP:declaration:function$Random text in the new template
120$/NEWTMP$
121----
122
123template column-data
124sectiondictionary "A"
125set MOOSE "FIRST"
126sectiondictionary "A"
127set MOOSE "VERY VERY LONG STRING THAT WILL BE CROPPED."
128sectiondictionary "A"
129set MOOSE "MIDDLE"
130sectiondictionary "A"
131set MOOSE "S"
132sectiondictionary "A"
133set MOOSE "LAST"
134----
135Table of Values:
136Left Justified | Right Justified$#A$
137$|MOOSE:20:right$ | $|MOOSE:20:left$$/A$
138----
139
140template custom-arg-handler :utest
141sectiondictionary "A"
142set MOOSE "why"
143----
144OUTSIDE SECTION: $UTESTVAR1$
145INSIDE SECTION: $#A$$UTESTVAR1$$/A$
146----
147
114f9c96 148;; end