Skip to content

Commit

Permalink
added support for c++20 module keywords 'module' and 'import' and sam…
Browse files Browse the repository at this point in the history
…ple. (#2023)
  • Loading branch information
Rasmus20B committed Mar 15, 2024
1 parent 61bdda1 commit 0dbee7d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rouge/lexers/cpp.rb
Expand Up @@ -27,7 +27,7 @@ def self.keywords
delete dynamic_cast explicit export friend
mutable namespace new operator private protected public
reinterpret_cast requires restrict size_of static_cast this throw throws
typeid typename using virtual final override
typeid typename using virtual final override import module

alignas alignof decltype noexcept static_assert
thread_local try
Expand Down
12 changes: 12 additions & 0 deletions spec/visual/samples/cpp
Expand Up @@ -265,3 +265,15 @@ switch (foo) {
case Foo::kBar:
break;
}

// modules
module;
import std;
export module Shapes;

export struct Shape {
Shape(int x, int y) : m_x(x), m_y(y) {};

int m_x;
int m_y;
}

0 comments on commit 0dbee7d

Please sign in to comment.