summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-04-24 20:12:36 -0700
committerAndreas Kling <kling@serenityos.org>2021-04-25 09:32:03 +0200
commit4022d3cb75cf3496ebfd051f7955a5fd2e214d99 (patch)
treeb47e852772e5347f8fcf38acad841c7e13fab8e5 /Userland/Libraries/LibWeb
parent7a73f1100575181ddc4bb8698440f2b72893ec83 (diff)
downloadserenity-4022d3cb75cf3496ebfd051f7955a5fd2e214d99.zip
LibWeb: Use SourceLocation for DeprecatedCSSParser logging.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp
index 883fb5b3b1..63970e07ae 100644
--- a/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp
+++ b/Userland/Libraries/LibWeb/CSS/Parser/DeprecatedCSSParser.cpp
@@ -5,6 +5,7 @@
*/
#include <AK/HashMap.h>
+#include <AK/SourceLocation.h>
#include <LibWeb/CSS/CSSImportRule.h>
#include <LibWeb/CSS/CSSRule.h>
#include <LibWeb/CSS/CSSStyleRule.h>
@@ -22,10 +23,10 @@
VERIFY_NOT_REACHED(); \
}
-#define PARSE_ERROR() \
- do { \
- dbgln("CSS parse error"); \
- } while (0)
+static inline void log_parse_error(const SourceLocation& location = SourceLocation::current())
+{
+ dbgln("CSS Parse error! {}", location);
+}
namespace Web {
@@ -325,11 +326,11 @@ public:
dbgln("CSSParser: Peeked '{:c}' wanted specific '{:c}'", peek(), ch);
}
if (!peek()) {
- PARSE_ERROR();
+ log_parse_error();
return false;
}
if (peek() != ch) {
- PARSE_ERROR();
+ log_parse_error();
++index;
return false;
}
@@ -795,12 +796,12 @@ public:
{
parse_selector_list();
if (!consume_specific('{')) {
- PARSE_ERROR();
+ log_parse_error();
return;
}
parse_declaration();
if (!consume_specific('}')) {
- PARSE_ERROR();
+ log_parse_error();
return;
}
@@ -810,7 +811,7 @@ public:
Optional<String> parse_string()
{
if (!is_valid_string_quotes_char(peek())) {
- PARSE_ERROR();
+ log_parse_error();
return {};
}
@@ -870,7 +871,7 @@ public:
if (!consume_specific(')'))
return;
} else {
- PARSE_ERROR();
+ log_parse_error();
return;
}