From 7b151e1faf989f065a5923c0cbef04f6da172b11 Mon Sep 17 00:00:00 2001 From: Theis Pieter Hollebeek Date: Thu, 12 Dec 2024 11:32:18 +0100 Subject: [PATCH] json.cpp -> fix comma/colon typo --- runtime/json.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/runtime/json.cpp b/runtime/json.cpp index 18f7e8a..660e689 100644 --- a/runtime/json.cpp +++ b/runtime/json.cpp @@ -1,7 +1,6 @@ #include "json.hpp" #include #include -#include #include #include #include @@ -15,11 +14,11 @@ auto ident_tok_typs = std::unordered_map { }; auto id_start_chars = "abcdefghijklmnopqrstuvwxyz" - "ABCDEFGHIJKLMNOPQRSTUVWXYZ_"; + "ABCDEFGHIJKLMNOPQRSTUVWXYZ_-"; auto id_tail_chars = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "1234567890"; + "1234567890-"; auto Lexer::next() -> Res { @@ -160,9 +159,9 @@ auto Parser::parse_val() -> Res> } auto key = this->lexer.val(this->cur.val().val_id); step(); - if (curtyp() != TokTyp::Comma) { + if (curtyp() != TokTyp::Colon) { return unexpected_tok_err( - TokTyp::Comma, "malformed object"); + TokTyp::Colon, "malformed object"); } step(); auto value = parse_val(); @@ -178,9 +177,9 @@ auto Parser::parse_val() -> Res> } auto key = this->lexer.val(this->cur.val().val_id); step(); - if (curtyp() != TokTyp::Comma) { + if (curtyp() != TokTyp::Colon) { return unexpected_tok_err( - TokTyp::Comma, "malformed object"); + TokTyp::Colon, "malformed object"); } step(); auto value = parse_val();