Skip to content

Commit e8a912e

Browse files
committed
Update parser and IR
1 parent 98d49de commit e8a912e

File tree

7 files changed

+25
-11
lines changed

7 files changed

+25
-11
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cmake_minimum_required(VERSION 3.15)
22
project(
33
Frontend.wasm
4-
VERSION 0.5.0
4+
VERSION 0.5.1
55
LANGUAGES CXX)
66

77
configure_file(docs/ReleaseNotes/version.in
@@ -36,7 +36,7 @@ include(FetchContent)
3636
FetchContent_Declare(
3737
IRSpecification
3838
GIT_REPOSITORY https://github.com/Tolc-Software/IntermediateRepresentation.git
39-
GIT_TAG v0.14.0)
39+
GIT_TAG v0.15.1)
4040

4141
FetchContent_MakeAvailable(IRSpecification)
4242

docs/ReleaseNotes/v0.5.1.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# News #
2+
3+
## Minor ##
4+
5+
* Updated Parser to v0.5.6
6+
* Updated IR to v0.15.1

src/Embind/Builders/classBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ buildClass(IR::Struct const& cppClass, Embind::Proxy::TypeInfo& typeInfo) {
125125
typeInfo);
126126
}
127127
jsClass.addMemberVariable(
128-
variable.m_name, getter, setter, variable.m_type.m_isStatic);
128+
variable.m_name, getter, setter, variable.m_isStatic);
129129
}
130130

131131
// Add default constructor

src/Embind/Proxy/function.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ void Function::allowPointers() {
165165
void Function::setAsVirtual(std::string const& base) {
166166
m_polymorphic = fmt::format(
167167
R"_tolc_delimiter(, optional_override([]({base}& self, {arguments}) {{
168-
return self.{base}::{functionName}({argumentsNames});
168+
return self.{base}::{functionName}({argumentNames});
169169
}}))_tolc_delimiter",
170170
fmt::arg("base", base),
171171
fmt::arg("arguments", getArgumentTypes(true)),

tests/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
include_guard()
22

33
include(${modules}/GetParser.cmake)
4-
get_parser(VERSION v0.4.1)
4+
get_parser(VERSION v0.5.6)
55

66
# Set the include path for the system library in the variable
77
# We are using the standard library shipped

tests/Embind/Builders/classBuilder.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ struct Var {
1717
TEST_CASE("Class with vector in member function gives the correct register",
1818
"[classBuilder]") {
1919
auto constructor = TestUtil::getFunction("SomeClass");
20-
constructor.m_arguments.push_back({"myVar", "", TestUtil::getVector()});
20+
IR::Argument arg;
21+
arg.m_name = "myVar";
22+
arg.m_type = TestUtil::getVector();
23+
constructor.m_arguments.push_back(arg);
2124
constructor.m_returnType = TestUtil::getMap();
2225

2326
auto s = TestUtil::getStruct("SomeClass");
@@ -37,7 +40,10 @@ TEST_CASE("Class with vector in member function gives the correct register",
3740

3841
TEST_CASE("Class with a constructor", "[classBuilder]") {
3942
auto constructor = TestUtil::getFunction("SomeClass");
40-
constructor.m_arguments.push_back({"myVar", "", TestUtil::getVector()});
43+
IR::Argument arg;
44+
arg.m_name = "myVar";
45+
arg.m_type = TestUtil::getVector();
46+
constructor.m_arguments.emplace_back(arg);
4147

4248
auto s = TestUtil::getStruct("SomeClass");
4349
s.m_public.m_constructors.push_back(constructor);
@@ -117,7 +123,7 @@ TEST_CASE("Class with functions", "[classBuilder]") {
117123
for (auto const& [function, type] : functions) {
118124
IR::Function f = TestUtil::getFunction(function);
119125

120-
IR::Variable v;
126+
IR::Argument v;
121127
v.m_name = "myVar";
122128

123129
IR::Type arg;
@@ -148,8 +154,11 @@ TEST_CASE("Class with vector in constructor gives the correct register command",
148154
"[classBuilder]") {
149155
IR::Struct s = TestUtil::getStruct("MyStruct");
150156
IR::Function constructor = TestUtil::getFunction("MyStruct");
151-
IR::Type arg = TestUtil::getVector();
152-
constructor.m_arguments.push_back({"myVar", "", arg});
157+
IR::Type v = TestUtil::getVector();
158+
IR::Argument arg;
159+
arg.m_name = "myVar";
160+
arg.m_type = v;
161+
constructor.m_arguments.push_back(arg);
153162
s.m_public.m_functions.push_back(constructor);
154163
Embind::Proxy::TypeInfo typeInfo;
155164
auto c = Embind::Builders::buildClass(s, typeInfo);

tests/TestUtil/include/TestUtil/types.hpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ IR::Type getType(IR::BaseType base = IR::BaseType::Int) {
5757
t.m_type = v;
5858
t.m_isConst = false;
5959
t.m_isReference = false;
60-
t.m_isStatic = false;
6160
t.m_numPointers = 0;
6261
t.m_representation = getAsString(base);
6362
return t;

0 commit comments

Comments
 (0)