Show More
@@ -105,6 +105,15 b' elements = {' | |||
|
105 | 105 | keywords = set(['and', 'or', 'not']) |
|
106 | 106 | |
|
107 | 107 | def tokenize(program): |
|
108 | ''' | |
|
109 | Parse a revset statement into a stream of tokens | |
|
110 | ||
|
111 | Check that @ is a valid unquoted token character (issue3686): | |
|
112 | >>> list(tokenize("@::")) | |
|
113 | [('symbol', '@', 0), ('::', None, 1), ('end', None, 3)] | |
|
114 | ||
|
115 | ''' | |
|
116 | ||
|
108 | 117 | pos, l = 0, len(program) |
|
109 | 118 | while pos < l: |
|
110 | 119 | c = program[pos] |
@@ -140,12 +149,12 b' def tokenize(program):' | |||
|
140 | 149 | else: |
|
141 | 150 | raise error.ParseError(_("unterminated string"), s) |
|
142 | 151 | # gather up a symbol/keyword |
|
143 | elif c.isalnum() or c in '._' or ord(c) > 127: | |
|
152 | elif c.isalnum() or c in '._@' or ord(c) > 127: | |
|
144 | 153 | s = pos |
|
145 | 154 | pos += 1 |
|
146 | 155 | while pos < l: # find end of symbol |
|
147 | 156 | d = program[pos] |
|
148 | if not (d.isalnum() or d in "._/" or ord(d) > 127): | |
|
157 | if not (d.isalnum() or d in "._/@" or ord(d) > 127): | |
|
149 | 158 | break |
|
150 | 159 | if d == '.' and program[pos - 1] == '.': # special case for .. |
|
151 | 160 | pos -= 1 |
General Comments 0
You need to be logged in to leave comments.
Login now