- Subject: [jed-users] Re: find outer brace
- From: Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 1 Oct 2015 16:21:42 +0200
On Tue 2015-09-29 (12:51), Ulli Horlacher wrote:
> How can I find the outer brace within a code block in C, slang or perl
> mode?
Ok, it was easy:
define goto_brace_next() {
variable bc = 0;
while (not bobp()) {
go_left(1);
switch (what_char())
{ case '}' : bc++; }
{ case '{' :
if (bc > 0) bc--;
if (bc == 0) return;
}
}
}
define goto_brace_outer() {
variable bc = 0;
while (not bobp()) {
go_left(1);
switch (what_char())
{ case '}' : bc++; }
{ case '{' :
if (bc == 0) return;
bc--;
}
}
}
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum IZUS/TIK E-Mail: horlacher@xxxxxxxxxxxxxxxxxxxx
Universitaet Stuttgart Tel: ++49-711-68565868
Allmandring 30a Fax: ++49-711-682357
70550 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
REF:<20150929105125.GA4590@xxxxxxxxxxxxxxxxxxxx>
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2015 date index]
[2015 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]