From: George H. <geo...@us...> - 2011-03-01 21:43:30
|
Update of /cvsroot/win32forth/win32forth/src/kernel In directory vz-cvs-4.sog:/tmp/cvs-serv13394 Modified Files: fkernel.f Log Message: Added proposed 200X {: :} loocals syntax Index: fkernel.f =================================================================== RCS file: /cvsroot/win32forth/win32forth/src/kernel/fkernel.f,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** fkernel.f 21 Dec 2010 19:55:28 -0000 1.68 --- fkernel.f 1 Mar 2011 21:43:26 -0000 1.69 *************** *** 5351,5355 **** REPEAT NIP TRUE ; ! |: BLNEXTWORD ( -- addr ln ) \ check for next word, if fails closing } is missing BL NEXTWORD 0= THROW_LOCALSNO} ?THROW UPPERCASE COUNT ; --- 5351,5355 ---- REPEAT NIP TRUE ; ! |: BLNEXTWORD ( -- addr ln ) \ check for next word, it fails if closing } or :} is missing BL NEXTWORD 0= THROW_LOCALSNO} ?THROW UPPERCASE COUNT ; *************** *** 5376,5379 **** --- 5376,5399 ---- ; IMMEDIATE + : {: ( -- ) \ begin local variable usage in the form; + \ {: initedloc1 initedloc2 \ uninitedloc3 -- comments :} + LOCALS-INIT + BEGIN BLNEXTWORD \ get next word + 2DUP S" --" STR= >R \ as in {: [...] -- ... + 2DUP S" :}" STR= R> OR INVERT \ as in {: [...] } ... + WHILE \ if neither, then not done + 2DUP S" |" STR= INVERT \ is it {: [...] | ... + IF {LOCAL} \ no, it's a local + ELSE 2DROP 0 TO LOCFLG THEN \ onto uninited locals + REPEAT + + BEGIN \ here at ... -- or ... } + S" :}" STR= INVERT + WHILE + BLNEXTWORD \ skip until we see ... } + REPEAT + PARMS, \ compile runtime code (equiv of 0 0 (LOCAL)) + ; IMMEDIATE + : LOCALS| ( -- ) \ ANS standard locals BEGIN BLNEXTWORD |