Mercurial > hg > Members > shinya > pyrect
changeset 71:3be07ba2d648
bug-fix: modify booster's stop rule. EOF - > stop.
author | Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Sun, 07 Nov 2010 13:45:20 +0900 |
parents | 74f4e50c4f11 |
children | 8b9c3a924744 |
files | pyrect/translator/grep_translator.py |
diffstat | 1 files changed, 1 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/pyrect/translator/grep_translator.py Sun Nov 07 09:32:46 2010 +0900 +++ b/pyrect/translator/grep_translator.py Sun Nov 07 13:45:20 2010 +0900 @@ -137,6 +137,7 @@ def emit_booster(self, min_len, chars): self.emiti("void booster(%s) {" % self.interface) self.emiti( "do {") + self.emit( "if (buf > end) return;") self.emiti( "switch (*(buf+%d)) {" % (min_len-1)) for c in chars: self.emit( "case %d: /* %s */" % (ord(c), Character.ascii(c)))