class: SyntaxElement
authorClaus Gittinger <cg@exept.de>
Sat, 28 Feb 2015 01:23:44 +0100
changeset 15467 f9546e28146e
parent 15466 a62dd831dbb8
child 15468 dfa524854f25
class: SyntaxElement class definition added: #isInBlockScope: #isInSameBlockScopeAs: refactored: pushed node up
SyntaxElement.st
--- a/SyntaxElement.st	Sat Feb 28 00:12:24 2015 +0100
+++ b/SyntaxElement.st	Sat Feb 28 01:23:44 2015 +0100
@@ -30,7 +30,7 @@
 "{ NameSpace: Smalltalk }"
 
 Magnitude subclass:#SyntaxElement
-	instanceVariableNames:'start stop type value next prev'
+	instanceVariableNames:'start stop type value next prev node'
 	classVariableNames:''
 	poolDictionaries:''
 	category:'Interface-CodeView-Syntax'
@@ -289,6 +289,14 @@
     ^ false.
 !
 
+isInBlockScope:aBlockScopeOrNil
+    ^ node notNil and:[ node block == aBlockScopeOrNil ]
+!
+
+isInSameBlockScopeAs:anotherElement
+    ^  node notNil and:[ anotherElement isInBlockScope:node block ]
+!
+
 isSelector
     ^ type == #selector
 
@@ -314,10 +322,10 @@
 !SyntaxElement class methodsFor:'documentation'!
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libtool/SyntaxElement.st,v 1.9 2015-02-27 20:21:34 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libtool/SyntaxElement.st,v 1.10 2015-02-28 00:23:44 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: SyntaxElement.st,v 1.9 2015-02-27 20:21:34 cg Exp $'
+    ^ '$Id: SyntaxElement.st,v 1.10 2015-02-28 00:23:44 cg Exp $'
 ! !