SmallSense__CompletionContext.st
changeset 108 71471dc81e77
child 132 7c23c51d2cfd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SmallSense__CompletionContext.st	Fri Sep 27 22:39:18 2013 +0100
@@ -0,0 +1,76 @@
+"{ Package: 'jv:smallsense' }"
+
+"{ NameSpace: SmallSense }"
+
+Object subclass:#CompletionContext
+	instanceVariableNames:'node position position1'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'SmallSense-Core'
+!
+
+
+!CompletionContext class methodsFor:'instance creation'!
+
+node: node position: position
+
+    ^self new node: node position: position
+
+    "Created: / 26-11-2011 / 16:22:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionContext methodsFor:'accessing'!
+
+node
+    ^ node
+!
+
+position
+    ^ position
+! !
+
+!CompletionContext methodsFor:'initialization'!
+
+node:nd position: pos
+
+    node := nd.
+    position := pos.
+    position1 := pos - 1
+
+    "Created: / 26-11-2011 / 16:22:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionContext methodsFor:'queries'!
+
+isAfterNode
+    ^ node notNil and:[node endPosition < position1]
+
+    "Created: / 26-11-2011 / 16:24:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-09-2013 / 13:11:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isBeforeNode
+    ^node notNil and:[position < node startPosition]
+
+    "Created: / 26-11-2011 / 16:24:10 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-09-2013 / 13:11:55 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
+isInNode
+    ^ node notNil and:[position1 between:node startPosition and:node endPosition]
+
+    "Created: / 26-11-2011 / 16:24:29 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+    "Modified: / 24-09-2013 / 13:12:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+! !
+
+!CompletionContext class methodsFor:'documentation'!
+
+version_HG
+
+    ^ '$Changeset: <not expanded> $'
+!
+
+version_SVN
+    ^ '$Id: SmallSensePosition.st 7823 2011-11-26 16:55:59Z vranyj1 $'
+! !
+