summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMitja Felicijan <mitja.felicijan@gmail.com>2026-01-22 01:59:17 +0100
committerMitja Felicijan <mitja.felicijan@gmail.com>2026-01-22 01:59:17 +0100
commit4c3e1ce7822a9acd3444b954d0bdbccade603c38 (patch)
treefdf349078d54a5ff10676fbd7d20edafe868a082 /tests
parentc7239b2906abb48110e3d41a18e94810af8ab915 (diff)
downloadcrep-4c3e1ce7822a9acd3444b954d0bdbccade603c38.tar.gz
Add C++ grammar
Diffstat (limited to 'tests')
-rw-r--r--tests/test.cpp32
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;
+}