Completed more cmds, getting close to the basic parsing

This commit is contained in:
Ryan Ward 2020-09-01 23:27:13 -04:00
parent 120ad85461
commit b9494b0803
28 changed files with 204 additions and 72 deletions

View File

@ -1,2 +1,2 @@
 LineParserParse.cpp  LineParserMatchProcess.cpp
DMS.vcxproj -> F:\VSCWorkspace\DMS\Debug\DMS.exe DMS.vcxproj -> F:\VSCWorkspace\DMS\Debug\DMS.exe

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -13,6 +13,7 @@
#include "token.h" #include "token.h"
#include "utils.h" #include "utils.h"
#include "Scope.h" #include "Scope.h"
#include "errors.h"
#include <stack> #include <stack>
@ -56,10 +57,10 @@ namespace dms {
std::vector<tokens::token> temp; std::vector<tokens::token> temp;
std::vector<tokens::token> tdump; std::vector<tokens::token> tdump;
size_t tabs = 0; size_t tabs = 0;
tokenstream* _stream; tokenstream* _stream = nullptr;
dms_state* state; dms_state* state = nullptr;
void doCheck(passer* stream, std::vector<tokens::token>* t_vec, size_t line, bool& isNum, bool& hasDec, std::vector<uint8_t>* buffer); void doCheck(passer* stream, std::vector<tokens::token>* t_vec, size_t line, bool& isNum, bool& hasDec, std::vector<uint8_t>* buffer);
void _Parse(tokenstream stream); void _Parse(tokenstream* stream);
// Match Process Code // Match Process Code
bool match_process_debug(tokenstream* stream); bool match_process_debug(tokenstream* stream);
bool match_process_disp(tokenstream* stream); bool match_process_disp(tokenstream* stream);
@ -70,6 +71,7 @@ namespace dms {
bool match_process_exit(tokenstream* stream); bool match_process_exit(tokenstream* stream);
bool match_process_expression(tokenstream* stream, value* v); bool match_process_expression(tokenstream* stream, value* v);
bool match_process_IFFF(tokenstream* stream); bool match_process_IFFF(tokenstream* stream);
bool match_process_assignment(tokenstream* stream);
// Build // Build
void buildGoto(std::string g, bool v = false); void buildGoto(std::string g, bool v = false);
void buildNoop(); void buildNoop();

View File

@ -12,7 +12,6 @@ namespace dms {
if ((isBlock(bt_block) || isBlock(bt_method)) && stream->match(tokens::newline, tokens::string, tokens::newline)) { if ((isBlock(bt_block) || isBlock(bt_method)) && stream->match(tokens::newline, tokens::string, tokens::newline)) {
stream->next(); // Standard consumption stream->next(); // Standard consumption
std::string msg = stream->next().name; std::string msg = stream->next().name;
print("DISP := ", msg);
cmd* c = new cmd; cmd* c = new cmd;
c->opcode = codes::DISP; c->opcode = codes::DISP;
c->args.push(buildValue()); c->args.push(buildValue());
@ -27,10 +26,9 @@ namespace dms {
std::string name = stream->next().name; std::string name = stream->next().name;
stream->next(); // That colon stream->next(); // That colon
std::string msg = stream->next().name; std::string msg = stream->next().name;
print("DISP := ", name, " says '", msg, "'");
cmd* c = new cmd; cmd* c = new cmd;
c->opcode = codes::DISP; c->opcode = codes::DISP;
c->args.push(buildValue(name)); c->args.push(buildVariable(name));
c->args.push(buildValue(msg)); c->args.push(buildValue(msg));
current_chunk->addCmd(c); // Add the cmd to the current chunk current_chunk->addCmd(c); // Add the cmd to the current chunk
// We might have to consume a newline... Depends on what's next // We might have to consume a newline... Depends on what's next
@ -45,7 +43,6 @@ namespace dms {
// Command to set the speaker // Command to set the speaker
stream->next(); stream->next();
stream->next(); stream->next();
print("Doing disp!!!");
while (stream->peek().type != tokens::cbracketc) { while (stream->peek().type != tokens::cbracketc) {
print(stream->peek()); print(stream->peek());
if (stream->match(tokens::name)) { if (stream->match(tokens::name)) {
@ -71,7 +68,12 @@ namespace dms {
if (stream->match(tokens::string)) { if (stream->match(tokens::string)) {
cmd* c = new cmd; cmd* c = new cmd;
c->opcode = codes::DACT; c->opcode = codes::DACT;
c->args.push(buildVariable(mode)); c->args.push(buildValue(mode));
current_chunk->addCmd(c);
// Now build the apnd msg cmd
c = new cmd;
c->opcode = codes::APND;
c->args.push(buildValue(stream->next().name));
current_chunk->addCmd(c); current_chunk->addCmd(c);
} }
else { else {
@ -80,7 +82,10 @@ namespace dms {
} }
} }
else if (stream->match(tokens::string)) { else if (stream->match(tokens::string)) {
cmd* c = new cmd;
c->opcode = codes::APND;
c->args.push(buildValue(stream->next().name));
current_chunk->addCmd(c);
} }
else if (stream->match(tokens::newline)) { else if (stream->match(tokens::newline)) {
stream->next(); stream->next();
@ -100,8 +105,74 @@ namespace dms {
return false; return false;
} }
bool LineParser::match_process_assignment(tokenstream* stream) {
// something equals something else lets go
if (stream->match(tokens::name,tokens::equal)) {
value* var = buildVariable(stream->next().name); // The variable that we will be setting stuff to
stream->next(); // Consume the equal
cmd* c = new cmd;
c->opcode = codes::ASGN;
c->args.push(var);
if (stream->match(tokens::True)) {
stream->next();
c->args.push(buildValue(true));
current_chunk->addCmd(c);
return true;
}
else if (stream->match(tokens::False)) {
stream->next();
c->args.push(buildValue(false));
current_chunk->addCmd(c);
return true;
}
else if (stream->match(tokens::string)) {
c->args.push(buildValue(stream->next().name));
current_chunk->addCmd(c);
return true;
}
else if (stream->match(tokens::nil)) {
stream->next();
c->args.push(buildValue());
current_chunk->addCmd(c);
return true;
}
else if (stream->match(tokens::number)) {
c->args.push(buildValue(std::stod(stream->next().name)));
current_chunk->addCmd(c);
return true;
}
else if (stream->match(tokens::bracketo, tokens::name, tokens::bracketc)) {
// We are assigning a block as a variable
stream->next();
c->args.push(buildBlock(stream->next().name));
current_chunk->addCmd(c);
stream->next();
return true;
}
else if (match_process_expression(stream,var)) {
// Expressions can internally set variables
// We actually need to clean up our cmds
current_chunk->cmds.pop_back();
delete c;
return true;
}
else if (match_process_function(stream,var)) {
// Functions can internally set variables
// We actually need to clean up our cmds
current_chunk->cmds.pop_back();
delete c;
return true;
}
else if (stream->match(tokens::name)) {
c->args.push(buildVariable(stream->next().name));
current_chunk->addCmd(c);
return true;
}
}
return false;
}
bool LineParser::match_process_debug(tokenstream* stream) { bool LineParser::match_process_debug(tokenstream* stream) {
if (stream->match(tokens::newline, tokens::debug, tokens::string) || stream->match(tokens::newline, tokens::debug, tokens::name)){ if (stream-> match(tokens::newline, tokens::debug, tokens::string) || stream->match(tokens::newline, tokens::debug, tokens::name)){
stream->next(); stream->next();
stream->next(); stream->next();
if (state->isEnabled("debugging")) { if (state->isEnabled("debugging")) {
@ -139,6 +210,7 @@ namespace dms {
c->args.push(buildValue(prompt)); c->args.push(buildValue(prompt));
current_chunk->addCmd(c); // We will keep a reference to this and add to it as we go through the list current_chunk->addCmd(c); // We will keep a reference to this and add to it as we go through the list
bool start = false; bool start = false;
bool hasfunc = false;
/* /*
What's going on here might be tough to understand just by looking at the code What's going on here might be tough to understand just by looking at the code
The bytecode generated by this code might look something like this: The bytecode generated by this code might look something like this:
@ -186,6 +258,7 @@ namespace dms {
// We consumed the option now lets do some matching, note that all of these are one liners in the bytecode! // We consumed the option now lets do some matching, note that all of these are one liners in the bytecode!
if (match_process_function(stream,nullptr,false)) { // No returns and also no nesting of functions! if (match_process_function(stream,nullptr,false)) { // No returns and also no nesting of functions!
// We cannot have a nested function here, but if we dont have that then we add our goto // We cannot have a nested function here, but if we dont have that then we add our goto
hasfunc = true;
buildGoto(str); buildGoto(str);
} }
else if (match_process_goto(stream)) { else if (match_process_goto(stream)) {
@ -206,7 +279,11 @@ namespace dms {
badSymbol(stream); badSymbol(stream);
} }
} }
buildLabel(str); cmd* cc = current_chunk->cmds.back(); // Delete last element
current_chunk->cmds.pop_back();
delete cc;
if (hasfunc)
buildLabel(str);
return true; return true;
} }
return false; return false;
@ -344,7 +421,7 @@ namespace dms {
return false; return false;
} }
bool LineParser::match_process_goto(tokenstream* stream) { bool LineParser::match_process_goto(tokenstream* stream) {
if (stream->match(tokens::gotoo,tokens::name) || tokens::gotoo,tokens::string) { if (stream->match(tokens::gotoo,tokens::name) || stream->match(tokens::gotoo,tokens::string)) {
stream->next(); // consume gotoo stream->next(); // consume gotoo
if (stream->match(tokens::name)) { if (stream->match(tokens::name)) {
buildGoto(stream->next().name,true); buildGoto(stream->next().name,true);

View File

@ -1,5 +1,4 @@
#include "LineParser.h" #include "LineParser.h"
#include "errors.h"
using namespace dms::tokens; using namespace dms::tokens;
using namespace dms::utils; using namespace dms::utils;
namespace dms { namespace dms {
@ -23,7 +22,7 @@ namespace dms {
if (myfile.is_open()) if (myfile.is_open())
{ {
std::string line; std::string line;
rawdata << ";;"; // For things to work I added 2 newlines. The issue is with how I decided to parse things. rawdata << ";;"; // For things to work I added 2 newlines. Using ';' doesn't change the actual line numbers
// This way you are allowed to start a block at the top of the screen! // This way you are allowed to start a block at the top of the screen!
while (std::getline(myfile, line)) { while (std::getline(myfile, line)) {
trim(line); trim(line);
@ -52,7 +51,7 @@ namespace dms {
stream.next('\n'); // Seek until you find a newline stream.next('\n'); // Seek until you find a newline
} }
else if (data == '\n') { else if (data == '\n') {
doCheck(&stream, &t_vec, line-2, isNum, hasDec, &buffer); doCheck(&stream, &t_vec, line, isNum, hasDec, &buffer);
t_vec.push_back(token{ tokens::newline,codes::NOOP,"",line }); t_vec.push_back(token{ tokens::newline,codes::NOOP,"",line });
if (isNum) { if (isNum) {
t_vec.push_back(token{ tokens::number,codes::NOOP,stream.processBuffer(buffer),line }); t_vec.push_back(token{ tokens::number,codes::NOOP,stream.processBuffer(buffer),line });
@ -297,13 +296,13 @@ namespace dms {
} }
outputFile.close(); outputFile.close();
} }
void LineParser::_Parse(tokenstream stream) { void LineParser::_Parse(tokenstream* stream) {
token current = stream.next(); token current = stream->next();
while (stream.peek().type != tokens::eof) { while (stream->peek().type != tokens::eof) {
print(current); print(current);
if (current.type == tokens::flag) { if (current.type == tokens::flag) {
temp = stream.next(tokens::newline); temp = stream->next(tokens::newline);
stream.prev(); // Unconsume the newline piece stream->prev(); // Unconsume the newline piece
if (temp.size() != 2) { if (temp.size() != 2) {
std::cout << "Error"; std::cout << "Error";
} }
@ -337,20 +336,20 @@ namespace dms {
} }
} }
// Default block // Default block
if (stream.match(tokens::newline,tokens::bracketo, tokens::name, tokens::bracketc)) { if (stream->match(tokens::newline,tokens::bracketo, tokens::name, tokens::bracketc)) {
stream.next(); stream->next();
stream.next(); stream->next();
std::string name = stream.next().name; std::string name = stream->next().name;
createBlock(name, bt_block); createBlock(name, bt_block);
line = stream.next().line_num; // Consume line = stream->next().line_num; // Consume
} }
// This handles a few block types since they all follow a similar format // This handles a few block types since they all follow a similar format
else if (stream.match(tokens::newline, tokens::bracketo, tokens::name, tokens::colon, tokens::name, tokens::bracketc)) { else if (stream->match(tokens::newline, tokens::bracketo, tokens::name, tokens::colon, tokens::name, tokens::bracketc)) {
stream.next(); stream->next();
stream.next(); stream->next();
std::string name = stream.next().name; std::string name = stream->next().name;
line = stream.next().line_num; line = stream->next().line_num;
std::string temp = stream.next().name; std::string temp = stream->next().name;
// Characters are a feature I want to have intergrated into the language // Characters are a feature I want to have intergrated into the language
if (temp == "char") { if (temp == "char") {
createBlock(name, bt_character); createBlock(name, bt_character);
@ -365,18 +364,18 @@ namespace dms {
} }
} }
// Function block type // Function block type
else if (stream.match(tokens::newline, tokens::bracketo, tokens::name, tokens::colon, tokens::name, tokens::parao)) { else if (stream->match(tokens::newline, tokens::bracketo, tokens::name, tokens::colon, tokens::name, tokens::parao)) {
std::stringstream str; std::stringstream str;
stream.next(); stream->next();
stream.next(); stream->next();
std::string name = stream.next().name; std::string name = stream->next().name;
line = stream.next().line_num; // The color, not needed after the inital match, but we still need to consume it line = stream->next().line_num; // The color, not needed after the inital match, but we still need to consume it
std::string b = stream.next().name; std::string b = stream->next().name;
if (b == "function") { if (b == "function") {
createBlock(name, bt_method); // We have a method let's set the block type to that, but we aren't done yet createBlock(name, bt_method); // We have a method let's set the block type to that, but we aren't done yet
// We need to set the params if any so the method can be supplied with arguments // We need to set the params if any so the method can be supplied with arguments
stream.next(); // parao stream->next(); // parao
std::vector<token> tokens = stream.next(tokens::parac); // Consume until we see parac std::vector<token> tokens = stream->next(tokens::parac); // Consume until we see parac
dms_args args; dms_args args;
for (size_t i = 0; i < tokens.size() - 1; i++) {//The lase symbol is parac since that was the consume condition for (size_t i = 0; i < tokens.size() - 1; i++) {//The lase symbol is parac since that was the consume condition
if (tokens[i].type == tokens::name) { if (tokens[i].type == tokens::name) {
@ -405,27 +404,26 @@ namespace dms {
} }
} }
// Control Handle all controls here // Control Handle all controls here
if (stream.match(tokens::control)) { if (stream->match(tokens::control)) {
//token control = stream.next(); //token control = stream->next();
if (match_process_choice(&stream)) { if (match_process_choice(stream)) {
// Handle choice stuff // Handle choice stuff
} }
else if (match_process_IFFF(&stream)) { else if (match_process_IFFF(stream)) {
// This will probably be the toughest one of them all // This will probably be the toughest one of them all
} }
} }
// Displays both with a target and without // Displays both with a target and without
match_process_disp(&stream); // Match and process displays match_process_disp(stream); // Match and process dialogue
if (stream.match(tokens::newline,tokens::label)) { // Match and process labels if (stream->match(tokens::newline,tokens::label)) { // Match and process labels
stream.next(); stream->next();
buildLabel(stream.next().name); buildLabel(stream->next().name);
} }
match_process_debug(&stream); match_process_assignment(stream);
match_process_debug(stream);
//if (current.type != tokens::tab) // Old code for an old system... match_process_goto(stream);
// tabs = 0; current = stream->next();
current = stream.next();
} }
createBlock("$END$", bt_block); createBlock("$END$", bt_block);
} }

View File

@ -1,5 +1,4 @@
#include "LineParser.h" #include "LineParser.h"
#include "errors.h"
using namespace dms::tokens; using namespace dms::tokens;
using namespace dms::utils; using namespace dms::utils;
namespace dms { namespace dms {
@ -78,6 +77,7 @@ namespace dms {
std::string passer::processBuffer(std::vector<uint8_t> buf) { std::string passer::processBuffer(std::vector<uint8_t> buf) {
return std::string(buf.begin(), buf.end()); return std::string(buf.begin(), buf.end());
} }
bool LineParser::isBlock() { bool LineParser::isBlock() {
return isBlock(bt_block); // Default block type return isBlock(bt_block); // Default block type
} }
@ -200,7 +200,7 @@ namespace dms {
stream.init(&toks); stream.init(&toks);
_stream = &stream; _stream = &stream;
this->state = state; // Grab the pointer to the state and store it within the parser object this->state = state; // Grab the pointer to the state and store it within the parser object
_Parse(stream); _Parse(&stream);
} }
void LineParser::tolower(std::string &s1) { void LineParser::tolower(std::string &s1) {
std::transform(s1.begin(), s1.end(), s1.begin(), std::tolower); std::transform(s1.begin(), s1.end(), s1.begin(), std::tolower);

View File

@ -6,7 +6,7 @@
namespace dms { namespace dms {
struct cmd struct cmd
{ {
dms::codes::op opcode; dms::codes::op opcode = codes::NOOP;
dms_args args; dms_args args;
friend std::ostream& operator << (std::ostream& out, const cmd& c) { friend std::ostream& operator << (std::ostream& out, const cmd& c) {
out << codes::list[c.opcode] << " "; out << codes::list[c.opcode] << " ";

View File

@ -19,6 +19,7 @@ namespace dms {
std::ofstream outputFile("dump.bin"); std::ofstream outputFile("dump.bin");
for (const auto& [key, val] : chunks) { for (const auto& [key, val] : chunks) {
std::cout << "Key: " << key << "<" << getBlockType(val->type) << ">" << std::endl << *val << std::endl; std::cout << "Key: " << key << "<" << getBlockType(val->type) << ">" << std::endl << *val << std::endl;
outputFile << "Key: " << key << "<" << getBlockType(val->type) << ">" << std::endl << *val << std::endl;
} }
//If the error has a chunk then we get the data from it //If the error has a chunk then we get the data from it
if (err.current_chunk != nullptr) { if (err.current_chunk != nullptr) {
@ -31,6 +32,7 @@ namespace dms {
std::ofstream outputFile("dump.bin"); std::ofstream outputFile("dump.bin");
for (const auto& [key, val] : chunks) { for (const auto& [key, val] : chunks) {
std::cout << "Key: " << key << "<" << getBlockType(val->type) << ">" << std::endl << *val << std::endl; std::cout << "Key: " << key << "<" << getBlockType(val->type) << ">" << std::endl << *val << std::endl;
outputFile << "Key: " << key << "<" << getBlockType(val->type) << ">" << std::endl << *val << std::endl;
} }
outputFile.close(); outputFile.close();
} }

Binary file not shown.

View File

@ -9,6 +9,4 @@ namespace dms::number_utils {
dms_number* abs(dms_state* state, dms_args args); dms_number* abs(dms_state* state, dms_args args);
dms_number* max(dms_state* state, dms_args args); dms_number* max(dms_state* state, dms_args args);
dms_number* pow(dms_state* state, dms_args args); dms_number* pow(dms_state* state, dms_args args);
} }

View File

@ -6,23 +6,72 @@ loadfile "loadtest.dms"
version 1.2 version 1.2
using extendedDefine using extendedDefine
[testblockpro]
"hehe"
[main] [main]
Ryan: "This works!" Bob: "Hi Ryan!"
DEBUG "What's up" // Debug lines are removed when debug mode is disabled DEBUG "What's up" // Debug lines are removed when debug mode is disabled
Ryan: { Ryan: {
true
speed 100;calm "Hello Bob, " speed 100;calm "Hello Bob, "
wait 0.455 wait 0.455
excited "how are you doing?" excited "how are you doing?"
// Becomes: Hello Bob, how are you doing? // Becomes: Hello Bob, how are you doing?
} }
Bob: {
speed 50
happy "You won't believe what just happened!"
}
Ryan: "Let me gue..."
Bob: {
speed 150
excited "I got the job! "
"The pay is amazing, "
speed 50
calm "but wait theres more!"
excited "I also get to go on a company trip and "
"I'm able to invite 2 friends to come along"
}
Ryan: {
happy "That's awesome! "
curious "Who do you plan on inviting?"
}
Bob: {
calm "Well you obviously, but I'm not sure who else I would want to bring..."
curious "Wanted to ask if you had any suggestions?"
}
Ryan: "Hmm, let me see..."
CHOICE "Who should I pick?" {
"Marie" goto "pickMarie"
"Sammy" goto "pickSammy"
"Ana" goto "pickAna"
"No Idea" goto "noIdea"
}
::pickMarie::
Ryan: "I think inviting Marie would be a good idea."
Bob: "I was actually thinking the same thing, let's invite her."
friend = [Marie] // Marie is a character block so obviously we set friend to a block
goto endpick
::pickSammy::
Ryan: "I think inviting Sammy would be a good idea."
Bob: "I haven't hung out with Sammy in too long, good pick."
friend = [Sammy]
goto endpick
::pickAna::
Ryan: "I think inviting Ana would be a good idea."
Bob: "Ana a name I haven't heard in a long time, sure sounds like a good time."
friend = [Ana]
goto endpick
::noIdea::
Ryan: "I really don't know who to bring..."
Bob: "Huh you having issues thinking of someone too. How about we bring Frank?"
Ryan: "Oh man Frank, for sure its been a minute since I last saw him."
friend = [Frank]
::endpick::
Bob: "Ill give ${friend} a call later!"
Ryan: "Sounds good looking forward to the trip!"
Bob: "Same, I'll send you the details later as well, see ya!"
Ryan: "Take care!"
tester = "Hello" tester = "Hello"
food = 3 food = 3
a = list[1]
if statment { if statment {
"test" "test"
@ -46,12 +95,10 @@ using extendedDefine
jump "overhere" jump "overhere"
hungry = (-2+4-((5*5)/sqrt(144+5)))^2*2+2 hungry = (-2+4-((5*5)/sqrt(144+5)))^2*2+2
list[1] = "Hello"
var1 = func(1,"string", 2+5) var1 = func(1,"string", 2+5)
a = 100 + func(1,"string", 2+5) + 100 a = 100 + func(1,"string", 2+5) + 100
func(1,"string", 2+5) func(1,"string", 2+5)
::mylabel:: ::mylabel::
//Hello im testing stuff
CHOICE "Pick one:" { CHOICE "Pick one:" {
"first" func(1,2,3) "first" func(1,2,3)
@ -66,8 +113,6 @@ using extendedDefine
"ten" exit 0 "ten" exit 0
} }
[Bob:char] [Bob:char]
age = 24 age = 24
money = 100 money = 100

View File

@ -52,7 +52,7 @@ namespace dms::tokens {
};//stream, t_vec, line, isNum, buffer };//stream, t_vec, line, isNum, buffer
struct token { struct token {
tokentype type = noop; tokentype type = noop;
codes::op raw = codes::NOOP; codes::op raw = codes::op::NOOP;
std::string name=""; std::string name="";
size_t line_num=0; size_t line_num=0;
void build(tokentype tt, codes::op o) { void build(tokentype tt, codes::op o) {
@ -121,7 +121,7 @@ namespace dms::tokens {
"ampersand", "ampersand",
"nil" "nil"
}; };
out << "Line <" << c.line_num << ">" << codes::list[c.raw] << " " << tokenlist[c.type] << " \t\t " << c.name; out << "Line <" << c.line_num << ">" << codes::list[(int)c.raw] << " " << tokenlist[c.type] << " \t\t " << c.name;
return out; return out;
} }
}; };

View File

@ -39,6 +39,12 @@ namespace dms {
std::string val = utils::concat("$",count); std::string val = utils::concat("$",count);
return buildVariable(val); return buildVariable(val);
} }
value* buildBlock(std::string str) {
value* val = new value{};
val->set(buildString(str));
val->type = block;
return val;
}
value* buildVariable(std::string str) { value* buildVariable(std::string str) {
value* val = new value{}; value* val = new value{};
val->set(buildString(str)); val->set(buildString(str));

View File

@ -6,7 +6,7 @@
namespace dms { namespace dms {
struct dms_env; struct dms_env;
enum datatypes { nil, number, boolean, env, string, custom, variable }; enum datatypes { nil, number, boolean, env, string, custom, variable, block };
struct dms_number { struct dms_number {
double val; double val;
double getValue() { return val; } double getValue() { return val; }
@ -77,6 +77,9 @@ namespace dms {
else if (c.type == custom) { else if (c.type == custom) {
out << (char)c.type << "Custom Data: " << c; out << (char)c.type << "Custom Data: " << c;
} }
else if (c.type == block) {
out << (char)c.type << c.s->getValue();
}
// Internal kinda // Internal kinda
else if (c.type == datatypes::variable) { else if (c.type == datatypes::variable) {
out << (char)c.type << c.s->getValue(); // Do the lookup out << (char)c.type << c.s->getValue(); // Do the lookup
@ -91,6 +94,7 @@ namespace dms {
value* buildValue(double dbl); value* buildValue(double dbl);
value* buildValue(int i); value* buildValue(int i);
value* buildValue(bool b); value* buildValue(bool b);
value* buildBlock(std::string str);
struct dms_args { struct dms_args {
std::vector<value*> args; std::vector<value*> args;

Binary file not shown.

Binary file not shown.

Binary file not shown.