Tinkering with gperf options
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "json_tokens.hpp"
|
||||
#include <string_view>
|
||||
|
||||
enum class JsonTokenType {
|
||||
Unknown = 0,
|
||||
Preconditions = 1,
|
||||
@@ -20,14 +23,11 @@ enum class JsonTokenType {
|
||||
RangeDelete = 16
|
||||
};
|
||||
|
||||
#include "json_tokens.hpp"
|
||||
#include <string_view>
|
||||
|
||||
inline JsonTokenType get_json_token_type(std::string_view str) {
|
||||
const JsonToken *token =
|
||||
Perfect_Hash::lookup_json_token(str.data(), str.size());
|
||||
if (token && token->name[0] != '\0') { // Check that we got a valid token
|
||||
if (token) {
|
||||
return static_cast<JsonTokenType>(token->token_id);
|
||||
}
|
||||
return JsonTokenType::Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user