Rewarite core with an AST for statements and RPN for expressions (#149)

* test

* improve ast

* add if statement

* shunting-yard start

* renderer as node visitor

* improve ast

* improve ast further

* first functions

* improve ast v3

* improve ast v4

* fix parser error location

* nested ifs

* fix comma, activate more tests

* fix line statements

* fix some more tests

* fix callbacks without arguments

* add json literal array and object

* use switch in expression

* fix default function

* fix loop data

* improved tests and benchmark

* fix minus numbers

* improve all

* fix warnings, optimizations

* fix callbacks argument order

* dont move loop parent

* a few more test

* fix clang-3

* fix pointers

* clean

* update single include
This commit is contained in:
pantor
2020-07-13 15:20:04 +02:00
committed by GitHub
parent 59d1d6b577
commit 6eb71dd3ea
22 changed files with 3329 additions and 2805 deletions

15
test/test.cpp Normal file
View File

@@ -0,0 +1,15 @@
// Copyright (c) 2020 Pantor. All rights reserved.
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include "doctest/doctest.h"
#include "inja/inja.hpp"
using json = nlohmann::json;
const std::string test_file_directory {"../test/data/"};
#include "test-files.cpp"
#include "test-functions.cpp"
#include "test-renderer.cpp"
#include "test-units.cpp"