Changeset 3183 for src/pge

Show
Ignore:
Timestamp:
05/13/05 22:25:21 (4 years ago)
Author:
autrijus
svk:copy_cache_prev:
4718
Message:

* trans_charset.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/pge/run_pge.pir

    r3079 r3183  
    11.sub _main 
    2     .local int spi, spc 
     2    .local int spi, spc, utf8 
    33    .local pmc args, match, add_rule 
     4    .local string name, rule, input, result 
    45    .include "iglobals.pasm" 
     6 
    57    load_bytecode "PGE/Hs.pir" 
     8    utf8        = charset "utf8" 
     9    add_rule    = find_global "PGE::Hs", "add_rule" 
    610 
    711    getinterp args 
     
    913    spi = 3 
    1014    spc = elements args 
    11     add_rule = find_global "PGE::Hs", "add_rule" 
    1215 
    1316  subrules: 
    1417    unless spi < spc goto do_match 
    15     $S1 = args[spi] 
     18    name    = args[spi] 
    1619    inc spi 
    17     $S2 = args[spi] 
     20    rule    = args[spi] 
    1821    inc spi 
    19     add_rule($S1, $S2) 
     22    trans_charset name, utf8 
     23    trans_charset rule, utf8 
     24    add_rule(name, rule) 
    2025    goto subrules 
    2126  do_match: 
    22     match = find_global "PGE::Hs", "match" 
    23     $S1 = args[1] 
    24     $S2 = args[2] 
    25     $S0 = match($S1, $S2) 
    26     print $S0 
     27    match   = find_global "PGE::Hs", "match" 
     28    input   = args[1] 
     29    rule    = args[2] 
     30    trans_charset input, utf8 
     31    trans_charset rule, utf8 
     32    result  = match(input, rule) 
     33    print result 
    2734.end