Website Summary Files Commits Branches @commit @diff @stats
path: root / JSImpl / src
diff options
context:
space:
mode:
2 files changed, 6 insertions, 5 deletions
-rw-r--r--JSImpl/src/ByteCodeGenerator.cpp8
-rw-r--r--JSImpl/src/JSONParser.cpp3
diff --git a/JSImpl/src/ByteCodeGenerator.cpp b/JSImpl/src/ByteCodeGenerator.cpp
index fd85326..49e734b 100644
--- a/JSImpl/src/ByteCodeGenerator.cpp
+++ b/JSImpl/src/ByteCodeGenerator.cpp
@@ -97,7 +97,7 @@ private:
void PushConst(double c);
IPLString CreateRegister();
- bool CheckOpCode(Instruction::Type opcode) { return opcode >= Instruction::Type::FIRST && opcode <= Instruction::Type::LAST; }
+ bool CheckOpCode(int opcode) { return opcode >= Instruction::Type::FIRST && opcode <= Instruction::Type::LAST; }
private:
IPLVector<IPLString> m_RegisterTable;
IPLVector<Instruction> m_Code;
@@ -646,8 +646,8 @@ IPLString ByteCodeGenerator::GetCode()
break;
case ByteCodeGenerator::Instruction::DEBUG:
{
- auto line = i.Values.Int[0];
- auto column = i.Values.Int[1];
+ auto line = int(i.Values.Int[0]);
+ auto column = int(i.Values.Int[1]);
result += "D: " + m_Source[line].substr(0, column) + "@@=>" + m_Source[line].substr(column, m_Source[line].size()) + '\n';
}
break;
@@ -678,4 +678,4 @@ IPLString GenerateByteCode(ExpressionPtr program, const IPLString& source, const
program->Accept(generator);
return generator.GetCode();
-} \ No newline at end of file
+}
diff --git a/JSImpl/src/JSONParser.cpp b/JSImpl/src/JSONParser.cpp
index 13ad9d6..275fb0e 100644
--- a/JSImpl/src/JSONParser.cpp
+++ b/JSImpl/src/JSONParser.cpp
@@ -3,6 +3,7 @@
#include <unordered_map>
#include <cstdlib>
+#include <cstring>
void SkipWhitespaces(const char*& json)
{
@@ -71,7 +72,7 @@ ExpressionPtr JSONParseWrap(const char*& json, const char* eName)
template <> \
ExpressionPtr JSONParseWrap<ClassName##Type>(const char*& json, const char* eName) \
{ \
- auto ptr = IPLMakeSharePtr<::##ClassName>(); \
+ auto ptr = IPLMakeSharePtr<::ClassName>(); \
int membersCount = 0, currentVisitCount = 0; \
(void)currentVisitCount; \
json += strlen("{"); \