Changeset 2945 for src/pge

Show
Ignore:
Timestamp:
05/10/05 21:35:00 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
4498
Message:

* external parrot should be able to play with subrules too

Location:
src/pge
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • src/pge/run_pge.imc

    r2889 r2945  
    11.sub _main 
     2    .local int spi, spc 
     3    .local pmc args, match, add_rule 
    24    .include "iglobals.pasm" 
    3     getinterp $P0 
    4     set $P0, $P0[.IGLOBALS_ARGV_LIST] 
    5     $S1 = $P0[1] 
    6     $S2 = $P0[2] 
    75    load_bytecode "PGE-Hs.pbc" 
    8     $P0 = find_global "PGE::Hs", "match" 
    9     $S0 = $P0($S1, $S2) 
     6 
     7    getinterp args 
     8    set args, args[.IGLOBALS_ARGV_LIST] 
     9    spi = 3 
     10    spc = elements args 
     11    add_rule = find_global "PGE::Hs", "add_rule" 
     12 
     13  subrules: 
     14    unless spi < spc goto do_match 
     15    $S1 = args[spi] 
     16    inc spi 
     17    $S2 = args[spi] 
     18    inc spi 
     19    add_rule($S1, $S2) 
     20  do_match: 
     21    match = find_global "PGE::Hs", "match" 
     22    $S1 = args[1] 
     23    $S2 = args[2] 
     24    $S0 = match($S1, $S2) 
    1025    print $S0 
    1126.end