1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 07:27:45 +00:00

LibSyntax: Teach each highlighter about it's comment syntax

This commit is contained in:
Kyle Lanmon 2022-10-26 10:01:13 -05:00 committed by Andrew Kaster
parent a8c73998f1
commit 31290c8527
11 changed files with 24 additions and 0 deletions

View file

@ -19,6 +19,8 @@ public:
virtual bool is_identifier(u64) const override;
virtual Syntax::Language language() const override { return Syntax::Language::GML; }
virtual Optional<StringView> comment_prefix() const override { return {}; }
virtual Optional<StringView> comment_suffix() const override { return {}; }
virtual void rehighlight(Palette const&) override;
protected:

View file

@ -17,6 +17,8 @@ public:
virtual ~GitCommitSyntaxHighlighter() override = default;
virtual Syntax::Language language() const override { return Syntax::Language::GitCommit; }
virtual Optional<StringView> comment_prefix() const override { return {}; }
virtual Optional<StringView> comment_suffix() const override { return {}; }
virtual void rehighlight(Palette const&) override;
protected:

View file

@ -19,6 +19,8 @@ public:
virtual bool is_identifier(u64) const override;
virtual Syntax::Language language() const override { return Syntax::Language::INI; }
virtual Optional<StringView> comment_prefix() const override { return ";"sv; }
virtual Optional<StringView> comment_suffix() const override { return {}; }
virtual void rehighlight(Palette const&) override;
protected: