Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor the unit tests for the SPARQL ANTLR parser #767

Merged
merged 27 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions src/parser/data/OrderKey.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@

#include "../../engine/sparqlExpressions/SparqlExpressionPimpl.h"

using std::string;
using std::variant;

/// Store an expression that appeared in an ORDER BY clause.
class ExpressionOrderKey {
public:
Expand All @@ -26,10 +23,10 @@ class ExpressionOrderKey {
/// Store a variable that appeared in an ORDER BY clause.
class VariableOrderKey {
public:
string variable_;
std::string variable_;
bool isDescending_;
// ___________________________________________________________________________
explicit VariableOrderKey(string variable, bool isDescending = false)
explicit VariableOrderKey(std::string variable, bool isDescending = false)
: variable_{std::move(variable)}, isDescending_{isDescending} {}

bool operator==(const VariableOrderKey&) const = default;
Expand Down
2 changes: 1 addition & 1 deletion src/parser/sparqlParser/SparqlQleverVisitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class SparqlQleverVisitor : public SparqlAutomaticVisitor {
using OperationsAndFilters =
std::pair<vector<GraphPatternOperation>, vector<SparqlFilter>>;
using OperationOrFilterAndMaybeTriples =
std::pair<variant<GraphPatternOperation, SparqlFilter>,
std::pair<std::variant<GraphPatternOperation, SparqlFilter>,
std::optional<GraphPatternOperation::BasicGraphPattern>>;
using OperationOrFilter = std::variant<GraphPatternOperation, SparqlFilter>;
using SubQueryAndMaybeValues =
Expand Down
22 changes: 22 additions & 0 deletions src/util/SourceLocation.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright 2022, University of Freiburg,
// Chair of Algorithms and Data Structures.
// Author: Julian Mundhahs (mundhahj@informatik.uni-freiburg.de)

// This compatibility header allows the usage of `ad_utility::source_location`
// (an alias to C++20's `std::source_location`) consistently across GCC and
// Clang. It is necessary, because `source_location` is currently still in the
// `std::experimental` namespace for Clang.

#pragma once

Qup42 marked this conversation as resolved.
Show resolved Hide resolved
#if defined(__clang__)
#include <experimental/source_location>
namespace ad_utility {
using source_location = std::experimental::source_location;
}
#else
#include <source_location>
namespace ad_utility {
using source_location = std::source_location;
}
#endif
Loading