Mercurial > hg > Members > shinya > pyrect
changeset 102:a38b57592d45
modify (add return statement).
author | Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 14 Dec 2010 04:08:56 +0900 |
parents | 5e509a9c951c |
children | abe36c207b23 |
files | pyrect/translator/grep_translator.py |
diffstat | 1 files changed, 7 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/pyrect/translator/grep_translator.py Tue Dec 14 04:08:09 2010 +0900 +++ b/pyrect/translator/grep_translator.py Tue Dec 14 04:08:56 2010 +0900 @@ -93,14 +93,14 @@ l = len(key) def emit_next(): if self.filter_only: - self.emit("accept(%s);" % self.args) + self.emit("return accept(%s);" % self.args) elif self.filter_prefix: self.emit("buf++;") - self.emit("%s(%s);" % (self.state_name(self.fa.start), self.args)) + self.emit("return %s(%s);" % (self.state_name(self.fa.start), self.args)) else: self.emit("beg = get_line_beg(buf, beg);") self.emit("buf = beg;") - self.emit("%s(%s);" % (self.state_name(self.fa.start), self.args)) + self.emit("return %s(%s);" % (self.state_name(self.fa.start), self.args)) self.emit("UCHARP get_line_beg(UCHARP p, UCHARP beg);", 2) self.emiti("void bmh_filter(%s) {" % self.interface) @@ -143,14 +143,14 @@ l = len(key) def emit_next(): if self.filter_only: - self.emit("accept(%s);" % self.args) + self.emit("return accept(%s);" % self.args) elif self.filter_prefix: self.emit("buf+%d;" % l) - self.emit("%s(%s);" % (self.state_name(self.fa.start) ,self.args)) + self.emit("return %s(%s);" % (self.state_name(self.fa.start) ,self.args)) else: self.emit("beg = get_line_beg(buf, beg);") self.emit("buf = beg;") - self.emit("%s(%s);" % (self.state_name(self.fa.start), self.args)) + self.emit("return %s(%s);" % (self.state_name(self.fa.start), self.args)) self.emit("UCHARP get_line_beg(UCHARP p, UCHARP beg);", 2) @@ -222,7 +222,6 @@ self.emit( "%s(%s);" % (self.state_name(self.fa.start), self.args)) self.emit( "return;") self.demit("}", 2) - return def emit_accept_state(self): self.emiti("void accept(%s) {" % self.interface) @@ -235,7 +234,7 @@ self.demit( "}") self.emit( "print_line(beg, ret);") self.emit( "beg = buf = ret + 1;") - self.emit( "%s(%s);" % (self.start, self.args)) + self.emit( "return %s(%s);" % (self.start, self.args)) self.demit("}", 2) def emit_reject_state(self):