cha-parser 0.6.4

Tree-sitter based AST parser for Cha (TypeScript, Rust)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <string>
#include <vector>

class Animal {
    std::string name;
    int age;
public:
    Animal(std::string n, int a) : name(n), age(a) {}
    std::string getName() { return name; }
};

int factorial(int n) {
    if (n <= 1) return 1;
    return n * factorial(n - 1);
}