summaryrefslogtreecommitdiffhomepage
path: root/cppbnf.cpp
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-11-21 15:19:45 +0100
committerRoland Reichwein <mail@reichwein.it>2020-11-21 15:19:45 +0100
commit7edbd99775416a32c88acf8e9379518436905f02 (patch)
tree6356edb79f846df4aa2f6a8a5ecfeef4e651bcc0 /cppbnf.cpp
parent7250bbe5ae2d2ee6b0334bc462aab73f7d8dac0e (diff)
Support gcc 10 and clang 11
Diffstat (limited to 'cppbnf.cpp')
-rw-r--r--cppbnf.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/cppbnf.cpp b/cppbnf.cpp
index 7e8ec15..3fddb66 100644
--- a/cppbnf.cpp
+++ b/cppbnf.cpp
@@ -7,9 +7,6 @@
#include <boost/algorithm/string/predicate.hpp>
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
using namespace std::string_literals;
namespace {
@@ -123,7 +120,7 @@ namespace {
void resolveOptional(std::vector<std::vector<std::string>>& lists)
{
- for (int i = 0; i < lists.size(); i++) {
+ for (size_t i = 0; i < lists.size(); i++) {
if (containsOptional(lists[i])) {
auto insertList = resolveOptional(lists[i]);
// replace element i with new list
@@ -150,7 +147,7 @@ namespace {
// vectorize terminal symbols
for (auto& [symbol, lists] : bnf) {
for (auto& list : lists) {
- for (int i = 0; i < list.size(); i++) {
+ for (size_t i = 0; i < list.size(); i++) {
if (list[i].size() > 1 && isTerminal(bnf, list[i])) {
auto newList = vectorize(list[i]);
list.erase(list.begin() + i);