| Index: tools/json_comment_eater/json_comment_eater.py
|
| diff --git a/tools/json_comment_eater/json_comment_eater.py b/tools/json_comment_eater/json_comment_eater.py
|
| index d61ece20e26ba8c8516bc223908a74e7b498f0c6..17a15254f4b42d80f9f8814ae02eebd591f8b904 100755
|
| --- a/tools/json_comment_eater/json_comment_eater.py
|
| +++ b/tools/json_comment_eater/json_comment_eater.py
|
| @@ -21,13 +21,12 @@ def _FindNextToken(string, tokens, start):
|
| '''Finds the next token in |tokens| that occurs in |string| from |start|.
|
| Returns a tuple (index, token key).
|
| '''
|
| - min_index, min_key = (-1, None)
|
| - for k in tokens:
|
| - index = string.find(k, start)
|
| - if index != -1 and (min_index == -1 or index < min_index):
|
| - min_index, min_key = (index, k)
|
| - return (min_index, min_key)
|
| + for index, item in enumerate(string, start):
|
| + for k in tokens:
|
| + if (string[index:index + len(k)] == k):
|
| + return (index, k)
|
|
|
| + return (-1, None)
|
|
|
| def _ReadString(input, start, output):
|
| output.append('"')
|
|
|