Skip to content

OneManMonkeySquad/Gllpp

Repository files navigation

This repo is for prototyping, production ready code coming later.

Parser grammar;

auto function = "def"_t + Capture<'{'>() + "{"_t + "}"_t;
auto cls = "struct"_t + Capture<'{'>() + "{"_t + "}"_t;
auto topLevelDefinition = (function | cls) + optional(grammar);
grammar = layout(topLevelDefinition, " \t\r\n");

auto code = "def test {}\n"
    "struct cls {}";

auto parseResults = grammar.parse(code);
REQUIRE(parseResults.size() == 1);
REQUIRE(parseResults[0].is_success());

Example Output

Releases

No releases published

Packages

No packages published

Languages