summaryrefslogtreecommitdiff
path: root/chapter22/docs/examples
diff options
context:
space:
mode:
Diffstat (limited to 'chapter22/docs/examples')
-rw-r--r--chapter22/docs/examples/BubbleSort.smp10
1 files changed, 5 insertions, 5 deletions
diff --git a/chapter22/docs/examples/BubbleSort.smp b/chapter22/docs/examples/BubbleSort.smp
index aa9cbbb8..a491bd82 100644
--- a/chapter22/docs/examples/BubbleSort.smp
+++ b/chapter22/docs/examples/BubbleSort.smp
@@ -20,27 +20,27 @@ struct Scan {
};
// Skip whitespace
-val skip = { Scan s ->
+val skip = { !Scan s ->
while( s.buf[s.x] <= ' ' )
s.x++;
};
// Require specific syntax or usage
-val require = { Scan s, u8 c ->
+val require = { !Scan !s, u8 c ->
skip(s);
if( s.buf[s.x++] != c )
usage();
};
-val peek = { Scan s, u8 c ->
+val peek = { !Scan !s, u8 c ->
skip(s);
if( s.buf[s.x] != c ) return false;
s.x++;
return true;
};
-val number = { Scan s ->
+val number = { !Scan s ->
skip(s);
i32 n = 0;
while( '0' <= s.buf[s.x] & s.buf[s.x] <= '9' )
@@ -64,7 +64,7 @@ val sort = { int[] ns, int len ->
// Read from stdin a line of the form "[ 4, 3, 2, 1]" and print it sorted.
val main = { ->
- Scan !s = new Scan{ buf = sys.io.stdin(); };
+ !Scan !s = new Scan{ buf = sys.io.stdin(); };
require(s,'[');
// Array of parsed results
int[] !ns = new int[16];