@@ -492,10 +492,10 @@ def declare_variable(self, id_: str, lineno: int, type_, default_value=None, cla
492
492
if entry_ .scope == SCOPE .parameter :
493
493
syntax_error (
494
494
lineno ,
495
- f"Variable '{ id_ } ' already declared as a parameter " f" at { entry_ .filename } :{ entry_ .lineno } " ,
495
+ f"Variable '{ id_ } ' already declared as a parameter at { entry_ .filename } :{ entry_ .lineno } " ,
496
496
)
497
497
else :
498
- syntax_error (lineno , f"Variable '{ id_ } ' already declared at " f" { entry_ .filename } :{ entry_ .lineno } " )
498
+ syntax_error (lineno , f"Variable '{ id_ } ' already declared at { entry_ .filename } :{ entry_ .lineno } " )
499
499
return None
500
500
501
501
if not self .check_class (id_ , class_ , lineno , scope = self .current_scope ):
@@ -525,7 +525,7 @@ def declare_variable(self, id_: str, lineno: int, type_, default_value=None, cla
525
525
if entry .type_ != type_ :
526
526
if not type_ .implicit and entry .type_ is not None :
527
527
syntax_error (
528
- lineno , "'%s' suffix is for type '%s' but it was " " declared as '%s'" % (id_ , entry .type_ , type_ )
528
+ lineno , "'%s' suffix is for type '%s' but it was declared as '%s'" % (id_ , entry .type_ , type_ )
529
529
)
530
530
return None
531
531
@@ -575,10 +575,10 @@ def declare_const(self, id_: str, lineno: int, type_, default_value):
575
575
if entry .scope == SCOPE .parameter :
576
576
syntax_error (
577
577
lineno ,
578
- "Constant '%s' already declared as a parameter " " at %s:%i" % (id_ , entry .filename , entry .lineno ),
578
+ "Constant '%s' already declared as a parameter at %s:%i" % (id_ , entry .filename , entry .lineno ),
579
579
)
580
580
else :
581
- syntax_error (lineno , "Constant '%s' already declared at " " %s:%i" % (id_ , entry .filename , entry .lineno ))
581
+ syntax_error (lineno , "Constant '%s' already declared at %s:%i" % (id_ , entry .filename , entry .lineno ))
582
582
return None
583
583
584
584
entry = self .declare_variable (id_ , lineno , type_ , default_value , class_ = CLASS .const )
@@ -600,7 +600,7 @@ def declare_label(self, id_: str, lineno: int) -> symbols.ID | None:
600
600
entry = self .get_entry (id_ )
601
601
if entry is not None and entry .declared :
602
602
if entry .is_line_number :
603
- syntax_error (lineno , "Duplicated line number '%s'. " " Previous was at %i" % (entry .name , entry .lineno ))
603
+ syntax_error (lineno , "Duplicated line number '%s'. Previous was at %i" % (entry .name , entry .lineno ))
604
604
else :
605
605
syntax_error (lineno , "Label '%s' already declared at line %i" % (id_ , entry .lineno ))
606
606
return None
@@ -680,23 +680,21 @@ def declare_array(self, id_: str, lineno: int, type_, bounds, default_value=None
680
680
if not entry .declared :
681
681
if entry .callable :
682
682
syntax_error (
683
- lineno , "Array '%s' must be declared before use. " " First used at line %i" % (id_ , entry .lineno )
683
+ lineno , "Array '%s' must be declared before use. First used at line %i" % (id_ , entry .lineno )
684
684
)
685
685
return None
686
686
else :
687
687
if entry .scope == SCOPE .parameter :
688
- syntax_error (
689
- lineno , "variable '%s' already declared as a " "parameter at line %i" % (id_ , entry .lineno )
690
- )
688
+ syntax_error (lineno , "variable '%s' already declared as a parameter at line %i" % (id_ , entry .lineno ))
691
689
else :
692
- syntax_error (lineno , "variable '%s' already declared at " " line %i" % (id_ , entry .lineno ))
690
+ syntax_error (lineno , "variable '%s' already declared at line %i" % (id_ , entry .lineno ))
693
691
return None
694
692
695
693
if entry .type_ != self .basic_types [TYPE .unknown ] and entry .type_ != type_ :
696
694
if not type_ .implicit :
697
695
syntax_error (
698
696
lineno ,
699
- "Array suffix for '%s' is for type '%s' " " but declared as '%s'" % (entry .name , entry .type_ , type_ ),
697
+ "Array suffix for '%s' is for type '%s' but declared as '%s'" % (entry .name , entry .type_ , type_ ),
700
698
)
701
699
return None
702
700
0 commit comments