fixed highlighting for not closed quote PY-9617

This commit is contained in:
Ekaterina Tuzova
2013-05-28 19:17:07 +04:00
parent a0dbf20614
commit ff63c30dfb
2 changed files with 12 additions and 6 deletions
@@ -73,8 +73,11 @@ TRIPLE_APOS_LITERAL = {THREE_APOS} {APOS_STRING_CHAR}* {THREE_APOS}?
%state IN_DOCSTRING_OWNER
%{
private int getSpaceLength(CharSequence string) {
int i = Math.max(StringUtil.lastIndexOf(string, '"', 0, string.length()), StringUtil.lastIndexOf(string, '\'', 0, string.length()));
return yylength()-i-1;
String string1 = string.toString();
string1 = StringUtil.trimEnd(string1, "\\");
string1 = StringUtil.trimEnd(string1, ";");
final String s = StringUtil.trimTrailing(string1);
return yylength()-s.length();
}
%}
@@ -1,4 +1,4 @@
/* The following code was generated by JFlex 1.4.3 on 5/28/13 6:11 PM */
/* The following code was generated by JFlex 1.4.3 on 5/28/13 7:15 PM */
/* It's an automatically generated code. Do not modify it. */
package com.jetbrains.python.lexer;
@@ -12,7 +12,7 @@ import com.intellij.openapi.util.text.StringUtil;
/**
* This class is a scanner generated by
* <a href="http://www.jflex.de/">JFlex</a> 1.4.3
* on 5/28/13 6:11 PM from the specification file
* on 5/28/13 7:15 PM from the specification file
* <tt>/home/ktisha/IDEA/tools/lexer/../../python/src/com/jetbrains/python/lexer/Python.flex</tt>
*/
class _PythonLexer implements FlexLexer {
@@ -677,8 +677,11 @@ class _PythonLexer implements FlexLexer {
/* user code: */
private int getSpaceLength(CharSequence string) {
int i = Math.max(StringUtil.lastIndexOf(string, '"', 0, string.length()), StringUtil.lastIndexOf(string, '\'', 0, string.length()));
return yylength()-i-1;
String string1 = string.toString();
string1 = StringUtil.trimEnd(string1, "\\");
string1 = StringUtil.trimEnd(string1, ";");
final String s = StringUtil.trimTrailing(string1);
return yylength()-s.length();
}