I seem to have stumbled on a bug in the way the parse instruction works in BREXX? specifically when a pattern is used. Here's a sample exec;
/* test parse */?
? trest = '() trial 1'
? say 'test of () trial 1'
? s = dotell(trest)
? trest = '(1) trial 2'
? say 'test of (1) trial 2'
? s = dotell(trest)
? trest = '(1 3) trial3'
? say 'test of (1 3) trial 3'
? s = dotell(trest)
? exit
?
dotell:
? parse arg with '(' in1 in2 ')' outer
? say 'in1 = /'in1'/'
? say 'in2 = /'in2'/'
? say 'outer=/'outer'/'
? return 0
only the third test works as it should, setting 'in1' to '1', 'in2' to '3' and 'outer' to 'trial 3'. The other two cases set 'in1' to ')' and '1) respectively, 'in2' to 'trial 1' and 'trial 2' and 'outer' to a null string.