Пример #1
0
 def insertLeft(self, type, text):
     token = CommonToken()
     token.type = type.value
     token.text = text
     token.line = self._dllTokens.value.line
     token.tokenIndex = self._dllTokens.value.tokenIndex
     inserted = self._dllAll.insert(token, self._dllTokens)
     return TokenEditor(inserted, self._dllAll)
Пример #2
0
    def insertRight(self, type, text):
        token = CommonToken()
        token.type = type.value
        token.text = text
        token.line = self._dllTokens.value.line
        token.tokenIndex = self._dllTokens.value.tokenIndex

        next = self._dllTokens.next
        if next:
            inserted = self._dllAll.insert(token, next)
        else:
            inserted = self._dllAll.append(token)
        return TokenEditor(inserted, self._dllAll)