diff options
| author | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-22 01:59:17 +0100 |
|---|---|---|
| committer | Mitja Felicijan <mitja.felicijan@gmail.com> | 2026-01-22 01:59:17 +0100 |
| commit | 4c3e1ce7822a9acd3444b954d0bdbccade603c38 (patch) | |
| tree | fdf349078d54a5ff10676fbd7d20edafe868a082 /tests | |
| parent | c7239b2906abb48110e3d41a18e94810af8ab915 (diff) | |
| download | crep-4c3e1ce7822a9acd3444b954d0bdbccade603c38.tar.gz | |
Add C++ grammar
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/test.cpp b/tests/test.cpp new file mode 100644 index 0000000..5538ba8 --- /dev/null +++ b/tests/test.cpp @@ -0,0 +1,32 @@ +#include <iostream> +#include <string> + +namespace my_namespace { + void namespaced_function() { + std::cout << "Namespaced function" << std::endl; + } + + class MyClass { + public: + void myMethod() { + std::cout << "Method inside class" << std::endl; + } + }; +} + +struct MyStruct { + int x; + void structMethod() { + std::cout << "Method inside struct" << std::endl; + } +}; + +void global_hello() { + std::cout << "Global hello" << std::endl; +} + +int main() { + global_hello(); + my_namespace::namespaced_function(); + return 0; +} |
