mirror of
https://github.com/pantor/inja.git
synced 2026-05-31 16:24:52 +00:00
update version, code style
This commit is contained in:
@@ -55,7 +55,9 @@ class FunctionStorage {
|
||||
FunctionData& get_or_new(nonstd::string_view name, unsigned int num_args) {
|
||||
auto &vec = m_map[static_cast<std::string>(name)];
|
||||
for (auto &i: vec) {
|
||||
if (i.num_args == num_args) return i;
|
||||
if (i.num_args == num_args) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
vec.emplace_back();
|
||||
vec.back().num_args = num_args;
|
||||
@@ -64,9 +66,14 @@ class FunctionStorage {
|
||||
|
||||
const FunctionData* get(nonstd::string_view name, unsigned int num_args) const {
|
||||
auto it = m_map.find(static_cast<std::string>(name));
|
||||
if (it == m_map.end()) return nullptr;
|
||||
if (it == m_map.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
for (auto &&i: it->second) {
|
||||
if (i.num_args == num_args) return &i;
|
||||
if (i.num_args == num_args) {
|
||||
return &i;
|
||||
}
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -182,7 +182,10 @@ class Lexer {
|
||||
}
|
||||
|
||||
m_pos = m_tok_start + 1;
|
||||
if (std::isalpha(ch)) return scan_id();
|
||||
if (std::isalpha(ch)) {
|
||||
return scan_id();
|
||||
}
|
||||
|
||||
switch (ch) {
|
||||
case ',':
|
||||
return make_token(Token::Kind::Comma);
|
||||
|
||||
Reference in New Issue
Block a user