eric6/ThirdParty/Jasy/jasy/script/tokenize/Tokenizer.py

changeset 7239
3e9e09a49cf5
parent 6942
2602857055c5
equal deleted inserted replaced
7238:c1eda208462b 7239:3e9e09a49cf5
160 """Eats comments and whitespace.""" 160 """Eats comments and whitespace."""
161 input = self.source 161 input = self.source
162 startLine = self.line 162 startLine = self.line
163 163
164 # Whether this is the first called as happen on start parsing a file (eat leading comments/white space) 164 # Whether this is the first called as happen on start parsing a file (eat leading comments/white space)
165 startOfFile = self.cursor is 0 165 startOfFile = self.cursor == 0
166 166
167 indent = "" 167 indent = ""
168 168
169 while (True): 169 while (True):
170 if len(input) > self.cursor: 170 if len(input) > self.cursor:
252 252
253 text += ch 253 text += ch
254 254
255 try: 255 try:
256 self.comments.append(Comment.Comment(text, mode, self.line-1, "", self.fileId)) 256 self.comments.append(Comment.Comment(text, mode, self.line-1, "", self.fileId))
257 except Comment.CommentException: 257 except Comment.CommentException as commentError:
258 Console.error("Ignoring comment in %s: %s", self.fileId, commentError) 258 Console.error("Ignoring comment in %s: %s", self.fileId, commentError)
259 259
260 # check for whitespace, also for special cases like 0xA0 260 # check for whitespace, also for special cases like 0xA0
261 elif ch in "\xA0 \t": 261 elif ch in "\xA0 \t":
262 indent += ch 262 indent += ch

eric ide

mercurial