|
Revision 81, 0.6 kB
(checked in by pguyot, 22 months ago)
|
|
New switch for configure to configure contrib packages.
New contrib package: inwt (interactive NEWT/0).
|
| Line | |
|---|
| 1 | #!@NEWT@ |
|---|
| 2 | |
|---|
| 3 | Require("NativeCalls"); |
|---|
| 4 | begin |
|---|
| 5 | local libreadline := OpenNativeLibrary("libreadline"); |
|---|
| 6 | local readlineFn := libreadline:GetFunction({ |
|---|
| 7 | name: "readline", |
|---|
| 8 | args: ['string], |
|---|
| 9 | result: 'string}); |
|---|
| 10 | |
|---|
| 11 | repeat |
|---|
| 12 | begin |
|---|
| 13 | local theString := call readlineFn with ("inwt> "); |
|---|
| 14 | if (theString = nil) then |
|---|
| 15 | begin |
|---|
| 16 | Print("\n"); |
|---|
| 17 | break; |
|---|
| 18 | end; |
|---|
| 19 | try |
|---|
| 20 | begin |
|---|
| 21 | theFunction := Compile(theString); |
|---|
| 22 | theResult := call theFunction with (); |
|---|
| 23 | P(theResult); |
|---|
| 24 | end |
|---|
| 25 | onexception |evt| do |
|---|
| 26 | begin |
|---|
| 27 | Print("Some error occurred:\n"); |
|---|
| 28 | P(CurrentException()); |
|---|
| 29 | end; |
|---|
| 30 | end until nil; |
|---|
| 31 | |
|---|
| 32 | end |
|---|