fixed da comma
This commit is contained in:
parent
73b9f4c81d
commit
bb58da84ce
2 changed files with 24 additions and 22 deletions
|
@ -36,20 +36,29 @@ namespace {
|
|||
stream.get(c);
|
||||
|
||||
bool no_more_nesting_quotes = false;
|
||||
for (auto const& x : current_scope.Scope)
|
||||
if (x == '\'' || x == '\"')
|
||||
for (auto& x : current_scope.Scope)
|
||||
{
|
||||
if (x == '\'' || x == '\"')
|
||||
{
|
||||
no_more_nesting_quotes = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool set_scope_on_this_iter = false;
|
||||
if (!no_more_nesting_quotes) {
|
||||
for (auto const& x : SCOPER_MAP)
|
||||
{
|
||||
if (c == x.first) {
|
||||
current_scope.Scope.push_back(c);
|
||||
current_scope.Scope.push_back(c);
|
||||
set_scope_on_this_iter = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!set_scope_on_this_iter && c == SCOPER_MAP.at(current_scope.Scope.back()))
|
||||
current_scope.Scope.pop_back();
|
||||
|
||||
if (c == '\\') // encounters an escaped sequence
|
||||
{
|
||||
char cc = stream.peek();
|
||||
|
@ -59,19 +68,17 @@ namespace {
|
|||
}
|
||||
}
|
||||
|
||||
if (c == SCOPER_MAP.at(current_scope.Scope.back()))
|
||||
current_scope.Scope.pop_back();
|
||||
|
||||
if (stream.eof())
|
||||
{
|
||||
std::cerr << "Can't cope with scope!" << std::endl;
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
final = stream.tellg();
|
||||
stream.seekg(initial);
|
||||
|
||||
|
||||
return final;
|
||||
}
|
||||
|
||||
|
@ -114,7 +121,7 @@ namespace NVL
|
|||
char c{};
|
||||
switch (nvl.peek())
|
||||
{
|
||||
case '[': // List, fucked
|
||||
case '[': // List
|
||||
nvl.get(c); // do not exchange this line with the next one
|
||||
end = scope_cope('[', nvl);
|
||||
while (nvl.tellg() < end - static_cast<std::streampos>(1))
|
||||
|
@ -133,6 +140,8 @@ namespace NVL
|
|||
while (nvl.tellg() < end - static_cast<std::streampos>(1))
|
||||
{
|
||||
nvl.get(c);
|
||||
if (c == '\\' && (nvl.peek() == '\'' || nvl.peek() == '\"'))
|
||||
continue;
|
||||
content = std::get<std::string>(content) + c;
|
||||
}
|
||||
nvl.get(c); // rid of final scoper
|
||||
|
@ -144,7 +153,7 @@ namespace NVL
|
|||
{
|
||||
content = std::get<std::string>(content) + c;
|
||||
}
|
||||
if (c == ']' || c == ',' || c == '}')
|
||||
if (c == ']' || c == '}')
|
||||
nvl.putback(c);
|
||||
|
||||
try
|
||||
|
@ -175,12 +184,12 @@ namespace NVL
|
|||
|
||||
if (is_parent_call)
|
||||
(std::get<std::reference_wrapper<Call>>(parent_context.Scope_Hierarchy.back())).get().Objects.push_back(this_object);
|
||||
else if ((std::get<std::reference_wrapper<Object>>(parent_context.Scope_Hierarchy.back())).get().Value.index() == 4) { // 4 for list
|
||||
;
|
||||
else if ((std::get<std::reference_wrapper<Object>>(parent_context.Scope_Hierarchy.back())).get().Value.index() == 4) // 4 for list
|
||||
{
|
||||
std::get<std::vector<Object>>((std::get<std::reference_wrapper<Object>>(parent_context.Scope_Hierarchy.back())).get().Value).push_back(this_object);
|
||||
}
|
||||
else {
|
||||
;
|
||||
else
|
||||
{
|
||||
(std::get<std::reference_wrapper<Object>>(parent_context.Scope_Hierarchy.back())).get().Value = std::vector<Object> { this_object };
|
||||
}
|
||||
}
|
||||
|
|
11
test.nvl
11
test.nvl
|
@ -1,10 +1,3 @@
|
|||
mmawesome
|
||||
{
|
||||
mmawesome mmaji awesome asduhjaiodhj kl;d 3434.3434 true false
|
||||
}
|
||||
|
||||
dasijhdoisaj {}
|
||||
|
||||
uihf98 {
|
||||
dasdj [39439048 jidjao] [] [] [] [[][[][[[[[] hi [2323 d]]]]]]]
|
||||
mmawesome {
|
||||
lmao [gkepokge hee hee [2323.4 535 3434]]
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue