[gforth] / gforth / kernel / args.fs  

gforth: gforth/kernel/args.fs

Diff for /gforth/kernel/args.fs between version 1.22 and 1.23

version 1.22, Tue Jan 31 15:25:44 2006 UTC version 1.23, Sat Feb 4 19:26:37 2006 UTC
Line 71 
Line 71 
 \g there is no argument left, return @code{0 0}.  \g there is no argument left, return @code{0 0}.
     1 arg shift-args ;      1 arg shift-args ;
   
   \ processing args on Gforth startup
   \ helper words
   
   : os-execute-parsing ( ... addr u xt -- ... )
       s" *OS command line*" execute-parsing-wrapper ;
   
   : args-required1 ( addr u -- )
       dup >in ! required ;
   
   : args-required ( i*x addr u -- i*x ) \ gforth
       2dup ['] args-required1 os-execute-parsing ;
   
   : args-evaluate ( i*x addr u -- j*x ) \ gforth
       ['] interpret os-execute-parsing ;
   
   \ main words
   
 : process-option ( addr u -- )  : process-option ( addr u -- )
     \ process option, possibly consuming further arguments      \ process option, possibly consuming further arguments
     2dup s" -e"         str= >r      2dup s" -e"         str= >r
     2dup s" --evaluate" str= r> or if      2dup s" --evaluate" str= r> or if
         2drop next-arg evaluate exit endif          2drop next-arg args-evaluate exit endif
     2dup s" -h"         str= >r      2dup s" -h"         str= >r
     2dup s" --help"     str= r> or if      2dup s" --help"     str= r> or if
         ." Image Options:" cr          ." Image Options:" cr
Line 91 
Line 108 
     BEGIN      BEGIN
         argc @ 1 > WHILE          argc @ 1 > WHILE
             next-arg over c@ [char] - <> IF              next-arg over c@ [char] - <> IF
                 required                  args-required
             else              else
                 process-option                  process-option
             then              then


Generate output suitable for use with a patch program
Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help