mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-02 15:46:33 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
44
Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h
Normal file
44
Libraries/LibWeb/HTML/SyntaxHighlighter/SyntaxHighlighter.h
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Ali Mohammad Pur <mpfard@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibSyntax/Highlighter.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
enum class AugmentedTokenKind : u32 {
|
||||
AttributeName,
|
||||
AttributeValue,
|
||||
OpenTag,
|
||||
CloseTag,
|
||||
Comment,
|
||||
Doctype,
|
||||
__Count,
|
||||
};
|
||||
|
||||
class SyntaxHighlighter : public Syntax::Highlighter {
|
||||
public:
|
||||
SyntaxHighlighter() = default;
|
||||
virtual ~SyntaxHighlighter() override = default;
|
||||
|
||||
virtual bool is_identifier(u64) const override;
|
||||
virtual bool is_navigatable(u64) const override;
|
||||
|
||||
virtual Syntax::Language language() const override { return Syntax::Language::HTML; }
|
||||
virtual Optional<StringView> comment_prefix() const override { return "<!--"sv; }
|
||||
virtual Optional<StringView> comment_suffix() const override { return "-->"sv; }
|
||||
virtual void rehighlight(Palette const&) override;
|
||||
|
||||
static constexpr u64 JS_TOKEN_START_VALUE = 1000;
|
||||
static constexpr u64 CSS_TOKEN_START_VALUE = 2000;
|
||||
|
||||
protected:
|
||||
virtual Vector<MatchingTokenPair> matching_token_pairs_impl() const override;
|
||||
virtual bool token_types_equal(u64, u64) const override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue