Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exceeded the maximum number of rules?
- Loading branch information
cgbsu@github.com
committed
Sep 1, 2022
1 parent
05d55cc
commit a5d6b2d
Showing
6 changed files
with
177 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <Warp/Common.hpp> | ||
#include <Warp/Utilities.hpp> | ||
|
||
#ifndef WARP__RUNTIME__COMPILER__HEADER__RUNTIME__COMPILER__FRAME__HPP | ||
#define WARP__RUNTIME__COMPILER__HEADER__RUNTIME__COMPILER__FRAME__HPP | ||
|
||
namespace Warp::Runtime::Compiler | ||
{ | ||
} | ||
|
||
#endif // WARP__RUNTIME__COMPILER__HEADER__RUNTIME__COMPILER__FRAME__HPP | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,51 @@ | ||
#include <Warp/Parsing/FunctionDeclarations.hpp> | ||
#include <Warp/Runtime/Compiler/SimpleExecutor.hpp> | ||
#include <CppUTest/TestHarness.h> | ||
#define WARP__TESTING__HEADER__TESTING__PARSE__TESTING__UTILITIES__HPP__CHECK__MACRO__REQUIRED CHECK | ||
#include <Warp/Testing/ParseTestingUtilities.hpp> | ||
|
||
using namespace Warp::Utilities; | ||
using namespace Warp::Testing; | ||
using namespace Warp::Parsing; | ||
using namespace Warp::Runtime::Compiler::SimpleExecutor; | ||
|
||
using WholeType = NumericTypeResolver<NumericTypeTag::Whole>::Type; | ||
using IntegerType = NumericTypeResolver<NumericTypeTag::Integer>::Type; | ||
using FixedType = NumericTypeResolver<NumericTypeTag::FixedPoint>::Type; | ||
using CharType = NumericTypeResolver<NumericTypeTag::Character>::Type; | ||
using BoolType = NumericTypeResolver<NumericTypeTag::Bool>::Type; | ||
|
||
using NumericConstantType = Constant<SyntaxNode, NumericTypeTag>; | ||
using NumericContexType = std::unordered_map<std::string, NumericConstantType>; | ||
|
||
// Test instantiation // | ||
template struct FunctionDeclarationParser< | ||
FunctionDeclaritionTermsType, | ||
NumericTypeResolver, | ||
NumericTypeTag::Whole | ||
Construct::Constant, | ||
NumericTypeTag, | ||
NumericConstantType | ||
>; | ||
|
||
using NumericParserType = FunctionDeclarationParser< | ||
FunctionDeclaritionTermsType, | ||
NumericTypeResolver, | ||
Construct::Constant, | ||
NumericTypeTag, | ||
NumericConstantType | ||
>; | ||
|
||
TEST_GROUP(FunctionDeclarations) {}; | ||
|
||
TEST(FunctionDeclarations, Nothing) {}; | ||
TEST(FunctionDeclarations, DeclareConstantFromLiteral) | ||
{ | ||
NumericContexType context; | ||
auto constant = runtime_parse< | ||
NumericParserType, | ||
FixedString{"let TheQuestion = 42;"}, | ||
Construct::Constant | ||
>(context, false); | ||
//std::cout << "Value: " << retrieve_value<WholeType>(constant.value).number << "\n"; | ||
|
||
}; | ||
|