- Timestamp:
- 05/18/05 20:35:47 (4 years ago)
- svk:copy_cache_prev:
- 4977
- Files:
-
- 1 modified
-
src/pge/run_pge.pir (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/pge/run_pge.pir
r3357 r3402 41 41 chopn arg2, 1 # skip \n 42 42 43 arg1 = unescape(arg1) 44 arg2 = unescape(arg2) 45 43 46 if cmd == "add_rule" goto do_add_rule 44 47 if cmd == "match" goto do_match … … 62 65 arg1 = args[1] 63 66 arg2 = args[2] 67 arg1 = unescape(arg1) 68 arg2 = unescape(arg2) 64 69 result = match(arg1, arg2) 65 70 print result … … 67 72 end: 68 73 .end 74 75 .sub unescape 76 .param string str 77 .local string ret, tmp 78 .local int i, j 79 80 ret = "" 81 j = length str 82 if j == 0 goto END 83 i = 0 84 85 LOOP: 86 tmp = str[i] 87 inc i 88 if i >= j goto FIN 89 90 eq tmp, "\\", ESC 91 concat ret, tmp 92 goto LOOP 93 94 ESC: 95 tmp = str[i] 96 inc i 97 eq tmp, "n", LF 98 concat ret, tmp 99 goto UNESC 100 LF: 101 concat ret, "\n" 102 UNESC: 103 inc i 104 if i >= j goto END 105 goto LOOP 106 107 FIN: 108 concat ret, tmp 109 END: 110 .return(ret) 111 .end
