git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refine the documentation, add extra warning messages
[lunaix-os.git]
/
lunaix-os
/
scripts
/
build-tools
/
lcfg2
/
rewriter.py
diff --git
a/lunaix-os/scripts/build-tools/lcfg2/rewriter.py
b/lunaix-os/scripts/build-tools/lcfg2/rewriter.py
index a86ab52852079cbe5f801f9f7bde8f2363350156..9a42447eae54e4dd7087046c7afb7f1e81b18085 100644
(file)
--- a/
lunaix-os/scripts/build-tools/lcfg2/rewriter.py
+++ b/
lunaix-os/scripts/build-tools/lcfg2/rewriter.py
@@
-1,6
+1,6
@@
import ast
import ast
-from lib.utils import Schema
+from lib.utils import Schema
, SourceLogger
from .lazy import Lazy
from .common import NodeProperty, NodeInverseDependency
from .lazy import Lazy
from .common import NodeProperty, NodeInverseDependency
@@
-139,6
+139,10
@@
class ConfigNodeASTRewriter(ast.NodeTransformer):
def visit_Return(self, node):
if self.__when_epxr:
def visit_Return(self, node):
if self.__when_epxr:
+ SourceLogger.warn(self.__cfg_node, node,
+ "mixed use of `return` and `when` directive. "
+ "`when` have higher precedence than `return`. "
+ "consider remove `return` to avoid confusion")
return None
return self.generic_visit(node)
return None
return self.generic_visit(node)