mirror of
https://github.com/nineties/planckforth
synced 2024-12-26 21:58:42 +01:00
Change name of constants uppercase
This commit is contained in:
parent
f20138a855
commit
fa2ac12c55
1 changed files with 11 additions and 9 deletions
20
bootstrap.fs
20
bootstrap.fs
|
@ -1150,7 +1150,7 @@ create s-buffer s-buffer-size allot drop
|
||||||
|
|
||||||
\ Will define the error message corresponds to this error later
|
\ Will define the error message corresponds to this error later
|
||||||
\ because we can't write string literal yet.
|
\ because we can't write string literal yet.
|
||||||
char 0 char B - constant string-overflow-error \ -18
|
char 0 char B - constant STRING-OVERFLOW-ERROR \ -18
|
||||||
|
|
||||||
\ Parse string delimited by "
|
\ Parse string delimited by "
|
||||||
\ compile mode: the string is stored as operand of 'string' operator.
|
\ compile mode: the string is stored as operand of 'string' operator.
|
||||||
|
@ -1170,7 +1170,7 @@ char 0 char B - constant string-overflow-error \ -18
|
||||||
s-buffer dup \ save start address
|
s-buffer dup \ save start address
|
||||||
begin key dup '"' <> while
|
begin key dup '"' <> while
|
||||||
2dup swap - s-buffer-size >= if
|
2dup swap - s-buffer-size >= if
|
||||||
throw string-overflow-error
|
throw STRING-OVERFLOW-ERROR
|
||||||
then
|
then
|
||||||
over c! \ store char
|
over c! \ store char
|
||||||
1+ \ increment address
|
1+ \ increment address
|
||||||
|
@ -1210,15 +1210,17 @@ variable error-list
|
||||||
string, \ fill message
|
string, \ fill message
|
||||||
;
|
;
|
||||||
|
|
||||||
|
: def-error ( n c-addr u "name" -- )
|
||||||
|
create 2 pick ,
|
||||||
|
add-error
|
||||||
|
does> @
|
||||||
|
;
|
||||||
|
|
||||||
decimal
|
decimal
|
||||||
|
|
||||||
s" -1" >number drop constant aborted-error
|
STRING-OVERFLOW-ERROR s" Too long string literal" add-error
|
||||||
|
|
||||||
aborted-error s" Aborted" add-error
|
s" -13" >number drop s" Undefined word" def-error UNDEFINED-WORD-ERROR
|
||||||
string-overflow-error s" Too long string literal" add-error
|
|
||||||
|
|
||||||
s" -13" >number drop constant undefined-word-error
|
|
||||||
undefined-word-error s" Undefined word" add-error
|
|
||||||
|
|
||||||
variable next-user-error
|
variable next-user-error
|
||||||
s" -256" >number drop next-user-error !
|
s" -256" >number drop next-user-error !
|
||||||
|
@ -1256,7 +1258,7 @@ create word-buffer s" 63" >number drop cell+ allot drop
|
||||||
then
|
then
|
||||||
else
|
else
|
||||||
>number unless
|
>number unless
|
||||||
undefined-word-error throw
|
UNDEFINED-WORD-ERROR throw
|
||||||
then
|
then
|
||||||
\ Not found
|
\ Not found
|
||||||
state @ if
|
state @ if
|
||||||
|
|
Loading…
Reference in a new issue