You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- to modify escape char from \
- to modify substitute sequence from $(
- only affects scripts loaded after this is changed
- use -escape:x and/or -substitute:xx from command line
- see testesc.gsl
Added 'code' and 'headers' targets into Makefile
- lets us regenerate all GXL code
- lets us rebuild the gsl.h file, since we don't use Boom any more
 <ahref="#toc4-1894">Structured Data Manipulation</a>
87
+
 <ahref="#toc4-1972">Script Manipulation</a>
88
+
 <ahref="#toc4-2002">Macros and Functions</a>
89
+
 <ahref="#toc4-2067">Miscellaneous</a>
90
+
 <ahref="#toc4-2082">Examples</a>
89
91
90
92
<Aname="toc2-10"title="Overview" />
91
93
## Overview
@@ -1317,7 +1319,23 @@ GSL helps you make neat COBOL code by automatically filling the first six charac
1317
1319
1318
1320
GSL uses as its line terminator the value of of the attribute `terminator` of the gsl scope. The default value is "\n" but it could also be set to "\r\n", for example.
1319
1321
1320
-
<Aname="toc4-1258"title="Arguments" />
1322
+
<Aname="toc4-1258"title="Escape Symbol" />
1323
+
#### Escape Symbol
1324
+
1325
+
GSL uses the backslash "\" as its default escape symbol, mainly due to its POSIX / C roots. This can be very annoying in templates that have a lot of backslashes. You can override the escape symbol by changing the [gsl].escape attribute, or using the -escape:X command-line switch.
1326
+
1327
+
Note that this takes effect for the next script loaded, so you cannot use this in a script to modify how that script itself is processed. You can use it before e.g. including a script.
1328
+
1329
+
<Aname="toc4-1265"title="Substitute Symbol" />
1330
+
#### Substitute Symbol
1331
+
1332
+
GSL uses the string "$(" to open a substitution sequence. You can use any string instead, by changing the [gsl].substitute attribute, or using the -substitute:X command-line switch.
1333
+
1334
+
Note that this takes effect for the next script loaded, so you cannot use this in a script to modify how that script itself is processed. You can use it before e.g. including a script.
1335
+
1336
+
Note also that the closing symbol is always ")" and you cannot override this.
1337
+
1338
+
<Aname="toc4-1274"title="Arguments" />
1321
1339
#### Arguments
1322
1340
1323
1341
If GSL is invoked with a `-a` switch, all arguments following the first are treated as arguments to the first script, rather than as further arguments to GSL, as would otherwise be the case. So if you type:
There are some identifiers whose value is maintained by GSL in the global space referred to by the predefined scopes `gsl` and `global`. They are defined as attributes of the global item.
@@ -1359,7 +1377,7 @@ version
1359
1377
switches
1360
1378
: A symbol table holding all the command-line switches present when GSL was invoked.
1361
1379
1362
-
<Aname="toc3-1300"title="Built-In Functions" />
1380
+
<Aname="toc3-1316"title="Built-In Functions" />
1363
1381
### Built-In Functions
1364
1382
1365
1383
GSL provides many built-in functions and uses `modules` to group related functions.
@@ -1382,7 +1400,7 @@ Some functions accept an optional parameter, listed as `error`. If the parameter
1382
1400
abort "E: cannot open directory: " + error_text
1383
1401
endif
1384
1402
1385
-
<Aname="toc4-1319"title="Global Functions" />
1403
+
<Aname="toc4-1335"title="Global Functions" />
1386
1404
#### Global Functions
1387
1405
1388
1406
alias (item)
@@ -1424,7 +1442,7 @@ Some functions accept an optional parameter, listed as `error`. If the parameter
GSL provides three modules for dealing with directories and files; one directory module and two file modules, one for working with independent files and the second for working with files during a directory traversal. We will discuss the second set after the first because it will make more sense that way.
@@ -1539,7 +1557,7 @@ The offset changes to reflect any read or write operations on the file. This is
1539
1557
1540
1558
The final set of file functions manipulate files, file names and file metadata.
1541
1559
1542
-
<Aname="toc4-1405"title="Directory Iteration" />
1560
+
<Aname="toc4-1421"title="Directory Iteration" />
1543
1561
#### Directory Iteration
1544
1562
1545
1563
As mentioned, previously, directories can be opened with the `directory.open` function, which returns a 'directory entry' object.
@@ -1805,7 +1823,7 @@ MODULE: GSL/fileio package
1805
1823
1806
1824
1807
1825
1808
-
<Aname="toc4-1471"title="gsl control" />
1826
+
<Aname="toc4-1487"title="gsl control" />
1809
1827
#### gsl control
1810
1828
1811
1829
Class: GSL Control Class
@@ -1819,7 +1837,7 @@ MODULE: GSL/fileio package
1819
1837
its output is returned as the result of this function. Uses the
1820
1838
current template mode unless over-ridden by the optional argument.
@@ -2204,7 +2222,7 @@ Inside a `for` or `while` loop causes immediate iteration, skipping execution of
2204
2222
2205
2223
Inside a `for` or `while` loop causes the loop to terminate iteration immediately. Control passes to the line following the `endfor` or `endwhile` statement. If the scope is specified then the `for` loop corresponding to that scope is terminated.
2206
2224
2207
-
<Aname="toc4-1832"title="Scope Manipulation" />
2225
+
<Aname="toc4-1848"title="Scope Manipulation" />
2208
2226
#### Scope Manipulation
2209
2227
2210
2228
**.scope**
@@ -2219,7 +2237,7 @@ Opens a new scope corresponding to the specified data.
2219
2237
2220
2238
Terminates a block opened with a .scope command, closing the scope. The scope name is optional and does not affect the operation. GSL confirms that its value is the name of the scope to be closed and reports an error if this is not the case. In this way, GSL can be made to validate nested .scope blocks for you.
2221
2239
2222
-
<Aname="toc4-1847"title="Symbol Definition" />
2240
+
<Aname="toc4-1863"title="Symbol Definition" />
2223
2241
#### Symbol Definition
2224
2242
2225
2243
.<data-specifier> [<operator>]= [ <expr> ]
@@ -2250,7 +2268,7 @@ Multiplies the value of the identifier x by 2.
2250
2268
2251
2269
Does nothing if x is already defined; otherwise assigns it the value of y, or if y is undefined then the value of z, or if z is undefined, x remains undefined.
2252
2270
2253
-
<Aname="toc4-1878"title="Structured Data Manipulation" />
2271
+
<Aname="toc4-1894"title="Structured Data Manipulation" />
2254
2272
#### Structured Data Manipulation
2255
2273
2256
2274
**.new**
@@ -2328,7 +2346,7 @@ Examples:
2328
2346
2329
2347
Sorts the specified items. A scope is created with each item in turn and is used to evaluate the expression. The result is then used to sort the items. The `as` clause allows you to give the created scope a different name. After execution, the specified items are in order and after any other children of the same parent.
2330
2348
2331
-
<Aname="toc4-1956"title="Script Manipulation" />
2349
+
<Aname="toc4-1972"title="Script Manipulation" />
2332
2350
#### Script Manipulation
2333
2351
2334
2352
**.include**
@@ -2358,7 +2376,7 @@ Turns template mode on or off.
2358
2376
2359
2377
Terminates the block introduced by a `template` instruction.
2360
2378
2361
-
<Aname="toc4-1986"title="Macros and Functions" />
2379
+
<Aname="toc4-2002"title="Macros and Functions" />
2362
2380
#### Macros and Functions
2363
2381
2364
2382
Macros and functions are pieces of GSL which can be invoked with parameters. The only difference between a macro and as function is that macros are interpreted in template mode and functions in script mode.
@@ -2423,7 +2441,7 @@ Examples:
2423
2441
.$(my.dest) = my.source
2424
2442
.endfunction
2425
2443
2426
-
<Aname="toc4-2051"title="Miscellaneous" />
2444
+
<Aname="toc4-2067"title="Miscellaneous" />
2427
2445
#### Miscellaneous
2428
2446
2429
2447
**.echo**
@@ -2438,7 +2456,7 @@ Outputs the given expression to the standard output.
2438
2456
2439
2457
Outputs the given expression to the standard output and halts GSL operation.
Copy file name to clipboardExpand all lines: README.txt
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1222,6 +1222,20 @@ GSL helps you make neat COBOL code by automatically filling the first six charac
1222
1222
1223
1223
GSL uses as its line terminator the value of of the attribute `terminator` of the gsl scope. The default value is "\n" but it could also be set to "\r\n", for example.
1224
1224
1225
+
#### Escape Symbol
1226
+
1227
+
GSL uses the backslash "\" as its default escape symbol, mainly due to its POSIX / C roots. This can be very annoying in templates that have a lot of backslashes. You can override the escape symbol by changing the [gsl].escape attribute, or using the -escape:X command-line switch.
1228
+
1229
+
Note that this takes effect for the next script loaded, so you cannot use this in a script to modify how that script itself is processed. You can use it before e.g. including a script.
1230
+
1231
+
#### Substitute Symbol
1232
+
1233
+
GSL uses the string "$(" to open a substitution sequence. You can use any string instead, by changing the [gsl].substitute attribute, or using the -substitute:X command-line switch.
1234
+
1235
+
Note that this takes effect for the next script loaded, so you cannot use this in a script to modify how that script itself is processed. You can use it before e.g. including a script.
1236
+
1237
+
Note also that the closing symbol is always ")" and you cannot override this.
1238
+
1225
1239
#### Arguments
1226
1240
1227
1241
If GSL is invoked with a `-a` switch, all arguments following the first are treated as arguments to the first script, rather than as further arguments to GSL, as would otherwise be the case. So if you type:
0 commit comments