Репозитории ALT
S: | 0.7.3-alt4 |
5.1: | 0.6.2-alt10 |
4.1: | 0.6.2-alt7 |
4.0: | 0.6.2-alt6 |
Группа :: Разработка/Прочее
Пакет: gforth
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: 04-minus-number.patch
Скачать
Скачать
Description: An upstream patch to not accept "-" as a valid number.
Origin: upstream; http://www.complang.tuwien.ac.at/viewcvs/cgi-bin/viewcvs.cgi/gforth/kernel/int.fs?r1=1.165&r2=1.166
Author: Anton Ertl <anton@mips.complang.tuwien.ac.at>
Last-Update: 2009-08-22
--- a/kernel/int.fs
+++ b/kernel/int.fs
@@ -163,21 +163,24 @@
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