Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  (the text interpreter number conversion treated "-" as 0)
  • Loading branch information
anton committed Jan 20, 2009
1 parent 2244c5f commit babed75
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions kernel/int.fs
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,24 @@ has? os 0= [IF]
over c@ '' = if
1 /string s'>unumber? exit
endif
base @ >r getbase sign? >r
0. 2swap
BEGIN ( d addr len )
dup >r >number dup
WHILE \ there are characters left
dup r> -
WHILE \ the last >number parsed something
dup 1- dpl ! over c@ [char] . =
WHILE \ the current char is '.'
1 /string
REPEAT THEN \ there are unparseable characters left
2drop rdrop false
base @ >r getbase sign?
over if
>r 0. 2swap
BEGIN ( d addr len )
dup >r >number dup
WHILE \ there are characters left
dup r> -
WHILE \ the last >number parsed something
dup 1- dpl ! over c@ [char] . =
WHILE \ the current char is '.'
1 /string
REPEAT THEN \ there are unparseable characters left
2drop rdrop false
ELSE
rdrop 2drop r> ?dnegate true
THEN
ELSE
rdrop 2drop r> ?dnegate true
THEN
drop 2drop 0. false THEN
r> base ! ;

\ ouch, this is complicated; there must be a simpler way - anton
Expand Down

0 comments on commit babed75

Please sign in to comment.