I'm fairly new to RJ TextEd, so I'll apologize up front for any stupid questions I ask in the future.
I have been doing some work with the Expect language, and want to create a syntax file for it. I'm trying to add the capability of folding up my functions in order to save time, but am having a hard time getting it right. The basic synatx of a function (proc) is:
proc <procName> { var-1 [var-2] [var-n] } {
<body of proc/function>
}
As an example here is a very basic proc.
proc rand {n} {
expr {int($n*rand())}
}
Thanks for any help.
Making Expect syntax file
- Rickard Johansson
- Site Admin
- Posts: 6628
- Joined: 19 Jul 2006 14:29
The problem is the extensive use of the {} - characters. Something like this works perfectly
It might be difficult to make this work in a future version, but I'll look into it. Maybe some simple option to ignore the first {} pair after the proc statement.
Code: Select all
proc rand (n) {
expr {int($n*rand())}
}
- Rickard Johansson
- Site Admin
- Posts: 6628
- Joined: 19 Jul 2006 14:29
Functions like
should work in the next release. No option is needed. You can use the same fold options as in the C++ syntax file.
Code: Select all
proc rand {n} {
expr {int($n*rand())}
}