|
|
@ -141,6 +141,9 @@ class Lexer: |
|
|
|
elif tid == 'dblquote': |
|
|
|
elif tid == 'dblquote': |
|
|
|
raise ParseException('Double quotes are not supported. Use single quotes.', self.getline(line_start), lineno, col) |
|
|
|
raise ParseException('Double quotes are not supported. Use single quotes.', self.getline(line_start), lineno, col) |
|
|
|
elif tid == 'string': |
|
|
|
elif tid == 'string': |
|
|
|
|
|
|
|
# Handle here and not on the regexp to give a better error message. |
|
|
|
|
|
|
|
if match_text.find("\n") != -1: |
|
|
|
|
|
|
|
raise ParseException("Use ''' (three single quotes) for multiline strings.", self.getline(line_start), lineno, col) |
|
|
|
value = match_text[1:-1].replace(r"\'", "'") |
|
|
|
value = match_text[1:-1].replace(r"\'", "'") |
|
|
|
value = newline_rx.sub(r'\1\n', value) |
|
|
|
value = newline_rx.sub(r'\1\n', value) |
|
|
|
value = value.replace(r" \\ ".strip(), r" \ ".strip()) |
|
|
|
value = value.replace(r" \\ ".strip(), r" \ ".strip()) |
|
|
|