separated token types for single/double and triple quoted strings

added lexer-level bytes/unicode detection
added lexer-level docstring detection
This commit is contained in:
Ekaterina Tuzova
2011-07-10 17:59:57 +04:00
parent c9a2641059
commit ef175a3436
42 changed files with 950 additions and 523 deletions

View File

@@ -60,18 +60,18 @@ public class PythonHighlightingTest extends PyLightFixtureTestCase {
doTest();
}
public void testDocStrings() {
EditorColorsManager manager = EditorColorsManager.getInstance();
EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
manager.addColorsScheme(scheme);
EditorColorsManager.getInstance().setGlobalScheme(scheme);
TextAttributesKey xKey = TextAttributesKey.find("PY.DOC_COMMENT");
TextAttributes xAttributes = new TextAttributes(Color.blue, Color.black, Color.white, EffectType.BOXED, Font.BOLD);
scheme.setAttributes(xKey, xAttributes);
doTest();
}
//public void testDocStrings() {
// EditorColorsManager manager = EditorColorsManager.getInstance();
// EditorColorsScheme scheme = (EditorColorsScheme)manager.getGlobalScheme().clone();
// manager.addColorsScheme(scheme);
// EditorColorsManager.getInstance().setGlobalScheme(scheme);
//
// TextAttributesKey xKey = TextAttributesKey.find("PY.DOC_COMMENT");
// TextAttributes xAttributes = new TextAttributes(Color.blue, Color.black, Color.white, EffectType.BOXED, Font.BOLD);
// scheme.setAttributes(xKey, xAttributes);
//
// doTest();
//}
public void testAssignmentTargets() {
setLanguageLevel(LanguageLevel.PYTHON26);
@@ -166,21 +166,21 @@ public class PythonHighlightingTest extends PyLightFixtureTestCase {
doTest();
}
public void testUnicodeOrByteRaw() {
doTest(LanguageLevel.PYTHON25, true, true);
}
public void testUnicodeOrByte25() {
doTest(LanguageLevel.PYTHON25, true, true);
}
public void testUnicodeOrByte26future() {
doTest(LanguageLevel.PYTHON26, true, true);
}
public void testUnicodeOrByte30() {
doTest(LanguageLevel.PYTHON30, true, true);
}
//public void testUnicodeOrByteRaw() {
// doTest(LanguageLevel.PYTHON25, true, true);
//}
//
//public void testUnicodeOrByte25() {
// doTest(LanguageLevel.PYTHON25, true, true);
//}
//
//public void testUnicodeOrByte26future() {
// doTest(LanguageLevel.PYTHON26, true, true);
//}
//
//public void testUnicodeOrByte30() {
// doTest(LanguageLevel.PYTHON30, true, true);
//}
// ---