cr before printing error line on error to match error position

This commit is contained in:
StackSmith 2023-09-19 11:04:42 -04:00
parent 2f2a6ba393
commit 5b50be4ddd
3 changed files with 13 additions and 4 deletions

8
nf.f
View File

@ -36,8 +36,8 @@ IMMEDIATE
HERE@ push
ws COMPILE.ONE
' dbra ,
pop ,
; IMMEDIATE
pop , ;
IMMEDIATE
: case \ ... n case ( ... ) Execute clause if n matches TOS.
' over , ' = , ' 0branch ,fixup, \ <over><=><nzbranch>|0...
@ -45,6 +45,7 @@ IMMEDIATE
HERE@ swap ! \ fixup
; IMMEDIATE
\ DEBUGGING SUPPORT
: sys
." DSP RSP HERE READ" cr
@ -63,6 +64,8 @@ IMMEDIATE
;
: dump dump16 dump16 dump16 dump16 ;
\ LAMBDA SUPPORT
\ compiling
\ lambdas are compiled blocks of code, to be passed around
\ <lit><lambda-address><branch><over-lambda>...lambda...<NEXT>|<---
@ -83,6 +86,7 @@ IMMEDIATE
dotprim ;
sync
\ [ " tstamp.f" included; ]
\ [ " cgi.f" included; ]

View File

@ -568,7 +568,7 @@ HEAD main,docol
dd xdup,lit,ERRNUM_EOF,minus,zbranch,.eof ;handle EOF
dd TIB,fetch,strlen,type ;print the error line
dd PARSE.PTR,fetch,TIB,fetch,minus
dd spaces,lit,'^',emit
dd cr,spaces,lit,'^',emit
dd state.rollback
dd branch, .in

View File

@ -1,6 +1,10 @@
\ Linux timestamp support
\
\ Works for Unix Epoch 32-bit timestamps after March 1972.
: ostime \ (-- s)
zero 13 oscall1 ;
: tstamp_conv \ (lintime -- d s)
68256000 - \ start on Mar 1, 1972,
TIMEZONE @ +
@ -37,7 +41,8 @@
swap rot
. $2D emit 2 u.r $2D emit 2 u.r sp ;
: now sys_time tstamp_conv time_conv time. date_conv date. ;
: now ostime tstamp_conv time_conv time. date_conv date. ;
sync