mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 12:46:31 +00:00
json.cpp -> fix comma/colon typo
This commit is contained in:
parent
9840269ab7
commit
7b151e1faf
@ -1,7 +1,6 @@
|
|||||||
#include "json.hpp"
|
#include "json.hpp"
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <format>
|
#include <format>
|
||||||
#include <iostream>
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
@ -15,11 +14,11 @@ auto ident_tok_typs = std::unordered_map<std::string, TokTyp> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
auto id_start_chars = "abcdefghijklmnopqrstuvwxyz"
|
auto id_start_chars = "abcdefghijklmnopqrstuvwxyz"
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ_-";
|
||||||
|
|
||||||
auto id_tail_chars = "abcdefghijklmnopqrstuvwxyz"
|
auto id_tail_chars = "abcdefghijklmnopqrstuvwxyz"
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||||
"1234567890";
|
"1234567890-";
|
||||||
|
|
||||||
auto Lexer::next() -> Res<Tok>
|
auto Lexer::next() -> Res<Tok>
|
||||||
{
|
{
|
||||||
@ -160,9 +159,9 @@ auto Parser::parse_val() -> Res<std::unique_ptr<Value>>
|
|||||||
}
|
}
|
||||||
auto key = this->lexer.val(this->cur.val().val_id);
|
auto key = this->lexer.val(this->cur.val().val_id);
|
||||||
step();
|
step();
|
||||||
if (curtyp() != TokTyp::Comma) {
|
if (curtyp() != TokTyp::Colon) {
|
||||||
return unexpected_tok_err(
|
return unexpected_tok_err(
|
||||||
TokTyp::Comma, "malformed object");
|
TokTyp::Colon, "malformed object");
|
||||||
}
|
}
|
||||||
step();
|
step();
|
||||||
auto value = parse_val();
|
auto value = parse_val();
|
||||||
@ -178,9 +177,9 @@ auto Parser::parse_val() -> Res<std::unique_ptr<Value>>
|
|||||||
}
|
}
|
||||||
auto key = this->lexer.val(this->cur.val().val_id);
|
auto key = this->lexer.val(this->cur.val().val_id);
|
||||||
step();
|
step();
|
||||||
if (curtyp() != TokTyp::Comma) {
|
if (curtyp() != TokTyp::Colon) {
|
||||||
return unexpected_tok_err(
|
return unexpected_tok_err(
|
||||||
TokTyp::Comma, "malformed object");
|
TokTyp::Colon, "malformed object");
|
||||||
}
|
}
|
||||||
step();
|
step();
|
||||||
auto value = parse_val();
|
auto value = parse_val();
|
||||||
|
Loading…
Reference in New Issue
Block a user