X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/9d4cc53314b8e2a236401733ac6c7093c97d4351..bf9d3cd7e165b3e8fc1a9edbbd5993332d673b51:/lunaix-os/scripts/build-tools/lcfg2/rules.py?ds=sidebyside diff --git a/lunaix-os/scripts/build-tools/lcfg2/rules.py b/lunaix-os/scripts/build-tools/lcfg2/rules.py index 3bf5683..f77460d 100644 --- a/lunaix-os/scripts/build-tools/lcfg2/rules.py +++ b/lunaix-os/scripts/build-tools/lcfg2/rules.py @@ -7,31 +7,9 @@ class SyntaxRule(RuleCollection): NodeAssigment = Schema(ast.Subscript, value=Schema(ast.Name, id='__lzLut__'), ctx=ast.Store) - TrivialValue = Schema(Schema.Union( - ast.Constant, - ast.Name - )) - BoolOperators = Schema(Schema.Union(ast.Or, ast.And)) - - TrivialTest = Schema(ast.Compare, - left=TrivialValue, - ops=[Schema.Union(ast.Eq)], - comparators=[ast.Constant]) - - InlineIf = Schema(ast.IfExp, - test=Schema.Union(TrivialTest, TrivialValue), - body=TrivialValue, - orelse=TrivialValue) - - TrivialLogic = Schema(ast.BoolOp, - op=BoolOperators, - values=Schema.List( - Schema.Union(TrivialTest, ast.Name) - )) - TrivialReturn = Schema(Schema.Union( - TrivialValue, + ast.Constant, ast.JoinedStr )) @@ -83,6 +61,6 @@ class SyntaxRule(RuleCollection): @rule(ast.Return, None, "non-trivial-value") def __nontrivial_return(self, reducer, node): """ - Option default should be kept as constant or simple membership check + Use of non-trivial value as default value """ return SyntaxRule.TrivialReturn == node.value \ No newline at end of file