mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:17:44 +00:00
LibSQL: Add a syntax highlighter
This commit is contained in:
parent
5423aba4ef
commit
984b6e08cf
5 changed files with 147 additions and 1 deletions
28
Userland/Libraries/LibSQL/SyntaxHighlighter.h
Normal file
28
Userland/Libraries/LibSQL/SyntaxHighlighter.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Dylan Katz <dykatz@uw.edu>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibSyntax/Highlighter.h>
|
||||
|
||||
namespace SQL {
|
||||
|
||||
class SyntaxHighlighter final : public Syntax::Highlighter {
|
||||
public:
|
||||
SyntaxHighlighter() { }
|
||||
virtual ~SyntaxHighlighter() override;
|
||||
|
||||
virtual bool is_identifier(void*) const override;
|
||||
|
||||
virtual Syntax::Language language() const override { return Syntax::Language::SQL; }
|
||||
virtual void rehighlight(const Palette&) override;
|
||||
|
||||
protected:
|
||||
virtual Vector<MatchingTokenPair> matching_token_pairs() const override;
|
||||
virtual bool token_types_equal(void*, void*) const override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue