Mercurial > hg > Members > shinya > pyrect
changeset 54:36cdfcaf5420
bug fix: modify anchor(begin of line - '^') emit rule.
author | Ryoma SHINYA <shinya@firefly.cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 25 Aug 2010 22:22:54 +0900 |
parents | 1f8c474ca8b3 |
children | 4ae288b37591 |
files | pyrect/jitgrep.py pyrect/translator/c_translator.py |
diffstat | 2 files changed, 2 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/pyrect/jitgrep.py Wed Aug 25 20:50:52 2010 +0900 +++ b/pyrect/jitgrep.py Wed Aug 25 22:22:54 2010 +0900 @@ -46,11 +46,6 @@ if opts.debug: print("args", args) string = args[1] - if string[0] == "^": - string = string[1:] - begline = True - else: - begline = False try: if opts.bufsize[-1] == 'K': @@ -71,7 +66,6 @@ grept = GoToGREPTranslator(reg) else: grept = GREPTranslator(reg) - grept.begline = begline grept.bufsize = bufsize if opts.dump:
--- a/pyrect/translator/c_translator.py Wed Aug 25 20:50:52 2010 +0900 +++ b/pyrect/translator/c_translator.py Wed Aug 25 22:22:54 2010 +0900 @@ -201,6 +201,7 @@ self._emit(" return %s(s);" % self.next) def visit_EndLine(self, endline): + self._emit("/* end of line */") self._emit(r"case '\0':") self._emit(" return %s(s);" % self.next) @@ -214,6 +215,7 @@ self._emit(" return %s(s+%d);" % (self.next, len(bytes)), 2) def visit_BegLine(self, begline): + self._emit("/* begin of line */") self._emit("if (s == buf)") self._emit(" return %s(s);" % self.next, 2)