[gobject-introspection] [annotationparser] Send in comments directly



commit 8f3a7cb0a1caa73a08e3f9879a862619098b50cc
Author: Johan Dahlin <johan gnome org>
Date:   Thu Sep 2 02:23:28 2010 -0300

    [annotationparser] Send in comments directly

 giscanner/annotationparser.py |    7 +++----
 giscanner/scannermain.py      |    4 ++--
 2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py
index fc5f77d..fedefcd 100644
--- a/giscanner/annotationparser.py
+++ b/giscanner/annotationparser.py
@@ -130,12 +130,11 @@ class AnnotationParser(object):
     OPTION_RE = re.compile(r'\([A-Za-z]+[^(]*\)')
     RETURNS_RE = re.compile(r'^return(s?)( value)?:', re.IGNORECASE)
 
-    def __init__(self, source_scanner):
+    def __init__(self):
         self._blocks = {}
-        self._source_scanner = source_scanner
 
-    def parse(self):
-        for comment in self._source_scanner.get_comments():
+    def parse(self, comments):
+        for comment in comments:
             self._parse_comment(comment)
         return self._blocks
 
diff --git a/giscanner/scannermain.py b/giscanner/scannermain.py
index 1baed83..dacffa2 100644
--- a/giscanner/scannermain.py
+++ b/giscanner/scannermain.py
@@ -317,8 +317,8 @@ def scanner_main(args):
     gdump_parser.set_introspection_binary(binary)
     gdump_parser.parse()
 
-    ap = AnnotationParser(ss)
-    blocks = ap.parse()
+    ap = AnnotationParser()
+    blocks = ap.parse(ss.get_comments())
 
     main = MainTransformer(transformer, blocks)
     main.transform()



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]