code: def declare_const(self, id_, lineno, type_, default_value):
          
          if not self.check_is_undeclared(id_, lineno, scope=self.current_scope, show_error=False):
              entry = self.get_entry(id_)
              if entry.scope == SCOPE.parameter:
                  syntax_error(lineno,
                               "Constant '%s' already declared as a parameter "
                               "at %s:%i" % (id_, entry.filename, entry.lineno))
              else:
                  syntax_error(lineno, "Constant '%s' already declared at "
                                       "%s:%i" % (id_, entry.filename, entry.lineno))
              return None
  
          entry = self.declare_variable(id_, lineno, type_, default_value)
          if entry is None:
              return None
  
          entry.class_ = CLASS.const
          return entry
docs: Similar to the above. But declares a Constant.