CodeGenerator.st
changeset 14423 ce279b3422b2
parent 10047 5962c20bb7d8
child 14717 7fd0faf76e90
--- a/CodeGenerator.st	Sat May 24 02:10:50 2014 +0200
+++ b/CodeGenerator.st	Sat May 24 02:10:56 2014 +0200
@@ -149,8 +149,12 @@
 
 createChange
 
-    | method |
-    method := RBParser parseRewriteMethod: source.
+    | parser method |
+    parser := RBParser new.
+    parser errorBlock:[ :str :pos | self error: ('Error: %1: %2' bindWith: pos with: str). ^ self ].
+    parser initializeParserWith: source type: #rewriteSavingCommentsOn:errorBlock:.
+    method := parser parseMethod: source.    
+
     method source: nil.
     method acceptVisitor: self.
     (change := InteractiveAddMethodChange new)
@@ -159,6 +163,7 @@
         source: method formattedCode.
 
     "Created: / 07-07-2009 / 18:44:42 / Jan Vrany <vranyj1@fel.cvut.cz>"
+    "Modified: / 24-05-2014 / 01:02:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 !
 
 replacePlaceholdersInSelectorPartsOf:aMessageNode 
@@ -205,9 +210,10 @@
 !CodeGenerator class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/CodeGenerator.st,v 1.2 2011-07-03 13:41:45 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/CodeGenerator.st,v 1.3 2014-05-24 00:10:56 vrany Exp $'
 !
 
 version_SVN
-    ^ '§Id: CodeGenerator.st 7567 2010-04-17 10:59:53Z vranyj1 §'
+    ^ '$Id: CodeGenerator.st,v 1.3 2014-05-24 00:10:56 vrany Exp $'
 ! !
+