Merge pull request #2461 from youkaichao/python/doc

update python runtime doc
This commit is contained in:
Terence Parr 2019-01-03 10:16:54 -07:00 committed by GitHub
commit 07735085bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -101,14 +101,11 @@ class TokenStreamRewriter(object):
return self.programs.setdefault(program_name, []) return self.programs.setdefault(program_name, [])
def getDefaultText(self): def getDefaultText(self):
return self.getText(self.DEFAULT_PROGRAM_NAME, 0, len(self.tokens.tokens)) return self.getText(self.DEFAULT_PROGRAM_NAME, 0, len(self.tokens.tokens) - 1)
def getText(self, program_name, start, stop): def getText(self, program_name, start, stop):
""" """
:type interval: IntervalSet.Interval :return: the text in tokens[start, stop](closed interval)
:param program_name:
:param interval:
:return:
""" """
rewrites = self.programs.get(program_name) rewrites = self.programs.get(program_name)

View File

@ -101,11 +101,11 @@ class TokenStreamRewriter(object):
return self.programs.setdefault(program_name, []) return self.programs.setdefault(program_name, [])
def getDefaultText(self): def getDefaultText(self):
return self.getText(self.DEFAULT_PROGRAM_NAME, 0, len(self.tokens.tokens)) return self.getText(self.DEFAULT_PROGRAM_NAME, 0, len(self.tokens.tokens) - 1)
def getText(self, program_name, start:int, stop:int): def getText(self, program_name, start:int, stop:int):
""" """
:return: :return: the text in tokens[start, stop](closed interval)
""" """
rewrites = self.programs.get(program_name) rewrites = self.programs.get(program_name)