forked from xxq250/Nasal-Interpreter
almost complete all var types
This commit is contained in:
36
lab.cpp
36
lab.cpp
@@ -1,6 +1,7 @@
|
||||
#include <iostream>
|
||||
#include "var.h"
|
||||
using namespace nasal;
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
@@ -33,11 +34,44 @@ int main()
|
||||
n.PrintList();
|
||||
std::cout<<std::endl;
|
||||
|
||||
//n.Append(&n,"array","n");//cause infinite loop
|
||||
n.Append(&n,"array");
|
||||
n.Append(&n,"array");
|
||||
n.PrintList();
|
||||
std::cout<<std::endl;
|
||||
|
||||
NasalList rm;
|
||||
rm.Append(&a,"int");
|
||||
rm.Append(&a,"int");
|
||||
rm.Append(&a,"int");
|
||||
rm.PrintList();
|
||||
std::cout<<std::endl;
|
||||
m.Append("fifth",&rm,"array");
|
||||
m.Append("sixth",&m,"hash");
|
||||
m.PrintHash();
|
||||
std::cout<<std::endl;
|
||||
|
||||
NasalHash test1(m);
|
||||
test1.PrintHash();
|
||||
NasalList test2(n);
|
||||
std::cout<<std::endl;
|
||||
test2.PrintList();
|
||||
std::cout<<std::endl;
|
||||
|
||||
n.Append(&m,"hash");
|
||||
n.PrintList();
|
||||
std::cout<<std::endl<<std::endl;
|
||||
|
||||
NasalList qt;
|
||||
qt.Append(&a,"int");
|
||||
a++;
|
||||
qt.Append(&a,"int");
|
||||
NasalHash qthash;
|
||||
qthash.Append("testlist",&qt,"array");
|
||||
qthash.PrintHash();
|
||||
std::cout<<std::endl;
|
||||
qthash.Append("int",&a,"int");
|
||||
qt.Append(&qthash,"hash");
|
||||
qt.PrintList();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user