*** empty log message ***
authorclaus
Mon, 21 Nov 1994 17:41:44 +0100
changeset 50 ab38fba1331e
parent 49 02660b790c3e
child 51 124369e443f8
*** empty log message ***
Parser.st
--- a/Parser.st	Thu Nov 17 15:23:23 1994 +0100
+++ b/Parser.st	Mon Nov 21 17:41:44 1994 +0100
@@ -38,7 +38,7 @@
 COPYRIGHT (c) 1989 by Claus Gittinger
 	     All Rights Reserved
 
-$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.18 1994-11-17 14:22:38 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.19 1994-11-21 16:41:44 claus Exp $
 '!
 
 !Parser class methodsFor:'documentation'!
@@ -59,7 +59,7 @@
 
 version
 "
-$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.18 1994-11-17 14:22:38 claus Exp $
+$Header: /cvs/stx/stx/libcomp/Parser.st,v 1.19 1994-11-21 16:41:44 claus Exp $
 "
 !
 
@@ -582,10 +582,20 @@
      The parser can be queried for selector, receiver, args, locals,
      used selectors, modified instvars, referenced classvars etc."
 
+    ^ self parseMethod:aString in:aClass warnings:true
+!
+
+parseMethod:aString in:aClass warnings:warnBoolean
+    "parse a method in a given class.
+     Return a parser (if ok), nil (empty) or #Error (syntax).
+     The parser can be queried for selector, receiver, args, locals,
+     used selectors, modified instvars, referenced classvars etc."
+
     |parser tree|
 
     aString isNil ifTrue:[^ nil].
     parser := self for:(ReadStream on:aString) in:aClass.
+    warnBoolean ifFalse:[parser ignoreWarnings].
     tree := parser parseMethod.
     (parser errorFlag or:[tree == #Error]) ifTrue:[^ nil].
     ^ parser
@@ -1588,11 +1598,11 @@
 	    tokenName = 'here' ifTrue:[
 		tokenType := #Here.
 		warnSTXHereExtensionUsed ifTrue:[
-                    self warning:'here-sends are a nonstandard feature of ST/X' 
-                         position:pos to:pos+3.
-                    "
-                     only warn once
-                    "
+		    self warning:'here-sends are a nonstandard feature of ST/X' 
+			 position:pos to:pos+3.
+		    "
+		     only warn once
+		    "
 		    warnSTXHereExtensionUsed := false
 		]
 	    ]
@@ -2633,15 +2643,15 @@
 		] ifFalse:[
 		    "if its a super send, we can do more checking"
 		    receiver isSuper ifTrue:[
-		        receiver isHere ifFalse:[
+			receiver isHere ifFalse:[
 			    (classToCompileFor superclass whichClassImplements:sym) isNil ifTrue:[
-			        err := ' is currently not implemented in any superclass'.
-			        ok := false
+				err := ' is currently not implemented in any superclass'.
+				ok := false
 			    ]
 			] ifTrue:[
 			    (classToCompileFor whichClassImplements:sym) isNil ifTrue:[
-			        err := ' is currently not implemented in this class'.
-			        ok := false
+				err := ' is currently not implemented in this class'.
+				ok := false
 			    ]
 			]
 		    ].