If 'search' was called outside of the parser, note. might be called, which would fail if no lexer was set
parent
9d68d5882a
commit
1addde1567
|
@ -496,3 +496,5 @@ DEFER: blah
|
||||||
|
|
||||||
[ "IN: parser.tests USE: kernel TUPLE: blah < tuple ; : blah ; TUPLE: blah < tuple ; : blah ;" eval ]
|
[ "IN: parser.tests USE: kernel TUPLE: blah < tuple ; : blah ; TUPLE: blah < tuple ; : blah ;" eval ]
|
||||||
[ error>> error>> def>> \ blah eq? ] must-fail-with
|
[ error>> error>> def>> \ blah eq? ] must-fail-with
|
||||||
|
|
||||||
|
[ ] [ f lexer set f file set "Hello world" note. ] unit-test
|
||||||
|
|
|
@ -25,7 +25,7 @@ t parser-notes set-global
|
||||||
: note. ( str -- )
|
: note. ( str -- )
|
||||||
parser-notes? [
|
parser-notes? [
|
||||||
file get [ path>> write ":" write ] when*
|
file get [ path>> write ":" write ] when*
|
||||||
lexer get line>> number>string write ": " write
|
lexer get [ line>> number>string write ": " write ] when*
|
||||||
"Note: " write dup print
|
"Note: " write dup print
|
||||||
] when drop ;
|
] when drop ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue