(self, var_type, line)
| 118 | # tail: the rest of input line |
| 119 | # You can assume that 'line == head + tail' |
| 120 | def split_var(self, var_type, line): |
| 121 | if var_type == 'keyword': |
| 122 | pos = line.find(' ') |
| 123 | if pos == -1: |
| 124 | return line, '' |
| 125 | else: |
| 126 | return line[:pos], line[pos:] |
| 127 | |
| 128 | raise self.InternalError('type "%s" is undefined' % var_type) |
| 129 | |
| 130 | # Return (mapped_value, tail) |
| 131 | # mapped_value: Python value/object from the consumed token(s) |