nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Fix syntax highlighting regex of C labels


From: Mike Frysinger
Subject: Re: [PATCH] Fix syntax highlighting regex of C labels
Date: Fri, 12 Mar 2021 23:18:17 -0500

On 12 Mar 2021 17:58, Hussam al-Homsi wrote:
> With this patch, a valid label like label1 in the following C code will now
> be highlighted:
> 
> #include <stdio.h>
> 
> int main(void) {
> 
> goto label1;
> 
> puts("skipped"); label1 : puts("reached");
> 
> }
> 
> The changes that enable this are described in the attached patch.

this handles C++ very very poorly :)

bool GetUserCrashDirectories(
    org::chromium::SessionManagerInterfaceProxyInterface* session_manager_proxy,
    std::vector<base::FilePath>* directories) {
  directories->clear();

  brillo::ErrorPtr error;
  std::map<std::string, std::string> sessions;
  session_manager_proxy->RetrieveActiveSessions(&sessions, &error);

  if (error) {
    LOG(ERROR) << "Error calling D-Bus proxy call to interface "
               << "'" << session_manager_proxy->GetObjectPath().value()
               << "': " << error->GetMessage();
    return false;
  }

  for (auto iter : sessions) {
    directories->push_back(
        paths::Get(brillo::cryptohome::home::GetHashedUserPath(iter.second)
                       .Append("crash")
                       .value()));
  }

  return true;
}

i guess the current style encourages you to not write labels like that
-mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]