We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 35078d5 commit b3ae1e8Copy full SHA for b3ae1e8
pkg/forth/builtin/02_core.f
@@ -489,3 +489,37 @@
489
LITERALIZE \ literalize the noname address
490
SWAP ! \ store the literal noname address inside the dummy value
491
; IMMEDIATE
492
+
493
+: PARSECHARRAW
494
+ DUP '0' U< IF
495
+ DROP -1 EXIT
496
+ THEN
497
+ DUP ':' U< IF
498
+ '0' - EXIT
499
500
+ DUP 'A' U< IF
501
502
503
+ DUP '[' U< IF
504
+ 'A' 10 - - EXIT
505
506
+ DUP 'a' U< IF
507
508
509
+ DUP '{' U< IF
510
+ 'a' 10 - - EXIT
511
512
+ DROP -1
513
+;
514
515
+\ Attempt to parse the character.
516
+\ If it is outside of the BASE, returns -1.
517
+: PARSECHAR ( c -- n )
518
+ PARSECHARRAW
519
+ DUP BASE @ 1- > IF
520
521
522
523
524
+\ : >NUMBER ( ud1 caddr1 u1 -- ud2 caddr2 u2 )
525
+\ ;
0 commit comments