update version, code style

This commit is contained in:
pantor
2020-04-10 15:58:05 +02:00
parent c2c95a4871
commit 8f2fac5d4d
5 changed files with 25 additions and 9 deletions

View File

@@ -52,7 +52,7 @@ If you are using the [Meson Build System](http://mesonbuild.com), then you can w
If you are using [Conan](https://conan.io) to manage your dependencies, have a look at [this repository](https://github.com/DEGoodmanWilson/conan-inja). Please file issues [here](https://github.com/DEGoodmanWilson/conan-inja/issues) if you experience problems with the packages.
You can also integrate inja in your project using [Hunter](https://github.com/ruslo/hunter), a package manager for C++.
You can also integrate inja in your project using [Hunter](https://github.com/cpp-pm/hunter), a package manager for C++.
If you are using [vcpkg](https://github.com/Microsoft/vcpkg) on your project for external dependencies, then you can use the [inja package](https://github.com/Microsoft/vcpkg/tree/master/ports/inja). Please see the vcpkg project for any issues regarding the packaging.

View File

@@ -38,7 +38,7 @@ PROJECT_NAME = "Inja"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 2.1.0
PROJECT_NUMBER = 2.2.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -1856,7 +1856,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;
@@ -1865,7 +1867,9 @@ 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;
}
@@ -2208,7 +2212,9 @@ 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);