emacs-diffs
[Top][All Lists]
Advanced

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

master ced2903: Add three C++20 coroutine keywords, co_await, co_yield,


From: Alan Mackenzie
Subject: master ced2903: Add three C++20 coroutine keywords, co_await, co_yield, and co_return
Date: Sun, 24 May 2020 07:54:55 -0400 (EDT)

branch: master
commit ced29038dfbab47428b974dff1408f331f36c8f1
Author: Carl Lei <address@hidden>
Commit: Alan Mackenzie <address@hidden>

    Add three C++20 coroutine keywords, co_await, co_yield, and co_return
    
    * lisp/progmodes/cc-langs.el (c-operators): Add co_await and co_yield to the
    C++ value of "Exception" keywords.
    (c-return-kwds): Create a C++ value containing co_return.
    (c-simple-stmt-kwds): Add co_return to the C++ value.
    
    Copyright-paperwork-exempt: yes.
---
 lisp/progmodes/cc-langs.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/cc-langs.el b/lisp/progmodes/cc-langs.el
index 17ffea5..2369cb0 100644
--- a/lisp/progmodes/cc-langs.el
+++ b/lisp/progmodes/cc-langs.el
@@ -1174,7 +1174,7 @@ since CC Mode treats every identifier as an expression."
 
       ;; Exception.
       ,@(when (c-major-mode-is 'c++-mode)
-         '((prefix "throw")))
+         '((prefix "throw" "co_await" "co_yield")))
 
       ;; Sequence.
       (left-assoc ","))
@@ -2040,6 +2040,7 @@ the appropriate place for that."
 (c-lang-defconst c-return-kwds
   "Keywords which return a value to the calling function."
   t '("return")
+  c++ '("return" "co_return")
   idl nil)
 
 (c-lang-defconst c-return-key
@@ -2822,6 +2823,7 @@ Keywords here should also be in `c-block-stmt-1-kwds'."
 (c-lang-defconst c-simple-stmt-kwds
   "Statement keywords followed by an expression or nothing."
   t    '("break" "continue" "goto" "return")
+  c++    '("break" "continue" "goto" "return" "co_return")
   objc '("break" "continue" "goto" "return" "@throw")
   ;; Note: `goto' is not valid in Java, but the keyword is still reserved.
   java '("break" "continue" "goto" "return" "throw")



reply via email to

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