File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -550,6 +550,42 @@ def _lint_node(
550550 f"Error: { 'Bundle' if 'bundle' in node .type else 'Body' } '{ _text (node )} ' conflicts with built-in function with the same name { location } "
551551 )
552552 return 1
553+ if state .promise_type == "vars" and node .type == "promise" :
554+ attribute_nodes = [x for x in node .children if x .type == "attribute" ]
555+ if not attribute_nodes :
556+ _highlight_range (node , lines )
557+ print (
558+ f"Error: Missing attribute value for promiser "
559+ f"{ _text (node )[:- 1 ]} inside vars-promise type { location } "
560+ )
561+ return 1
562+
563+ mutually_excl_vars_attrs = {
564+ "data" ,
565+ "ilist" ,
566+ "int" ,
567+ "real" ,
568+ "rlist" ,
569+ "slist" ,
570+ "string" ,
571+ }
572+
573+ promise_type_attrs = {
574+ _text (child ): attr_node
575+ for attr_node in attribute_nodes
576+ for child in attr_node .children
577+ if child .type == "attribute_name"
578+ and _text (child ) in mutually_excl_vars_attrs
579+ }
580+
581+ if len (promise_type_attrs ) > 1 :
582+ for n in promise_type_attrs :
583+ _highlight_range (promise_type_attrs [n ], lines )
584+ print (
585+ f"Error: Mutually exclusive attribute values { tuple (promise_type_attrs )} for a single promiser"
586+ f" inside vars-promise { location } "
587+ )
588+ return 1
553589 if node .type == "calling_identifier" :
554590 name = _text (node )
555591 qualified_name = _qualify (name , state .namespace )
You can’t perform that action at this time.
0 commit comments