Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

A few minor tweaks. I modified Parse so that the character and line c…

…ounters reflect the characters *leaving* the queue, rather than entering. I also realized that there's no need to mutate pairs in Bignum.
  • Loading branch information...
commit ad418f0506262a4716e29e5ca2ff20480be9ed67 1 parent dd3b431
@JohnEarnest authored
Showing with 7 additions and 9 deletions.
  1. +0 −2  lib/Algorithms/Bignum.fs
  2. +7 −7 lib/Parse.fs
View
2  lib/Algorithms/Bignum.fs
@@ -18,8 +18,6 @@
: pair 2 alloc dup >r ptr> swap over 1 + ! ! r> ; ( first rest -- pair )
: first ptr> @ ; ( pair -- first )
: rest ptr> 1 + @ ; ( pair -- rest )
-: first! ptr> ! ; ( value pair -- )
-: rest! ptr> 1 + ! ; ( value pair -- )
: split dup first swap rest ; ( pair -- first rest )
: -split dup rest swap first ; ( pair -- rest first )
View
14 lib/Parse.fs
@@ -31,12 +31,12 @@
######################################################
:data line 1
-:var char
+:data char 1
: advance ( char -- )
10 = if
line inc
- 0 char !
+ 1 char !
else
char inc
then
@@ -50,7 +50,7 @@
halt
;
-:vector read CO @ dup advance ; ( -- char )
+:vector read CO @ ; ( -- char )
:var text-src
: read-text ( -- char )
@@ -87,10 +87,10 @@
:var b # tail
:var s # size
-: q+ dup @ 1 + qs mod swap ! ; ( addr -- )
-: >q a @ q + ! a q+ s inc ; ( char -- )
-: q> b @ q + @ b q+ s dec ; ( -- char )
-: clear-q 0 a ! 0 b ! 0 s ! ; ( -- )
+: q+ dup @ 1 + qs mod swap ! ; ( addr -- )
+: >q a @ q + ! a q+ s inc ; ( char -- )
+: q> b @ q + @ b q+ s dec dup advance ; ( -- char )
+: clear-q 0 a ! 0 b ! 0 s ! ; ( -- )
: xq ( index -- char )
s @ over <= if
Please sign in to comment.
Something went wrong with that request. Please try again.