mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
PY-45
This commit is contained in:
@@ -53,7 +53,7 @@ public class ReturnAnnotator extends PyAnnotator {
|
||||
*/
|
||||
}
|
||||
|
||||
private class YieldVisitor extends PyElementVisitor {
|
||||
private static class YieldVisitor extends PyElementVisitor {
|
||||
private boolean _haveYield = false;
|
||||
|
||||
public boolean haveYield() {
|
||||
@@ -71,5 +71,10 @@ public class ReturnAnnotator extends PyAnnotator {
|
||||
node.acceptChildren(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitPyFunction(final PyFunction node) {
|
||||
// do not go to nested functions
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
python/testData/highlighting/yieldInNestedFunction.py
Normal file
4
python/testData/highlighting/yieldInNestedFunction.py
Normal file
@@ -0,0 +1,4 @@
|
||||
def foo():
|
||||
def a():
|
||||
yield 1
|
||||
return False
|
||||
@@ -47,6 +47,9 @@ public class PythonHighlightingTest extends DaemonAnalyzerTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testYieldInNestedFunction() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() throws Exception {
|
||||
doTest(getTestName(true) + ".py", true, true);
|
||||
|
||||
Reference in New Issue
Block a user