From 956bc5c85c937f791dedefa00b4cacdfee08e26b Mon Sep 17 00:00:00 2001 From: codeboss <2422523675@qq.com> Date: Wed, 12 Feb 2025 13:55:48 +0800 Subject: [PATCH] update --- libSyntax/syntax_novel.cpp | 28 ++++++++++++++-------------- libSyntax/syntax_templets.h | 6 +++--- libSyntax/tokens_novel.cpp | 8 ++++---- libSyntax/tokens_novel.h | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/libSyntax/syntax_novel.cpp b/libSyntax/syntax_novel.cpp index 603661d..4eec808 100644 --- a/libSyntax/syntax_novel.cpp +++ b/libSyntax/syntax_novel.cpp @@ -49,7 +49,7 @@ void rank_set(std::shared_ptr inst, std::shared_ptrsetRank(token->content().toInt()); } -using TextDeclsSyntaxDef = lib_composit::Multi, TokenRn, TokenRn, TokenRn>>; +using TextDeclsSyntaxDef = lib_composit::Multi, TMate, TMate, TMate>>; class DeclSyntax : public ElementRule { public: DeclSyntax() : ElementRule("decl_section") { } @@ -62,9 +62,9 @@ public: -using PointSyntaxDef = lib_composit::SeqsR, TokenRn, TokenR, +using PointSyntaxDef = lib_composit::SeqsR, TMate, TAct, Opt, - TokenRn>; + TMate>; class PointSyntax : public ElementRule { public: PointSyntax() : ElementRule("point_define") { } @@ -77,9 +77,9 @@ public: -using ReferSyntaxDef = lib_composit::SeqsR, TokenRn, TokenRn, TokenR, TokenRn, TokenR, TokenRn, TokenR, +using ReferSyntaxDef = lib_composit::SeqsR, TMate, TMate, TAct, TMate, TAct, TMate, TAct, Opt, - TokenRn>; + TMate>; class ReferSyntax : public ElementRule { public: ReferSyntax() : ElementRule < PointRefers, (int) NovelNode::PointRefers, ReferSyntaxDef>("point_refer") { } @@ -92,9 +92,9 @@ public: -using SliceSyntaxDef = lib_composit::SeqsR, TokenRn, TokenR, +using SliceSyntaxDef = lib_composit::SeqsR, TMate, TAct, lib_composit::OptMulti>, - TokenRn>; + TMate>; class SliceSyntax : public ElementRule { public: SliceSyntax() : ElementRule("slice_define") { } @@ -107,9 +107,9 @@ public: -using StorySyntaxDef = lib_composit::SeqsR, TokenRn, TokenR, +using StorySyntaxDef = lib_composit::SeqsR, TMate, TAct, lib_composit::OptMulti>, - TokenRn>; + TMate>; class StorySyntax : public ElementRule { public: StorySyntax() : ElementRule("story_define") { } @@ -122,9 +122,9 @@ public: -using ArticleSyntaxDef = lib_composit::SeqsR, TokenRn, TokenR, +using ArticleSyntaxDef = lib_composit::SeqsR, TMate, TAct, lib_composit::OptMulti>, - TokenRn>; + TMate>; class ArticleSyntax : public ElementRule { public: ArticleSyntax() : ElementRule("article_define") { } @@ -137,9 +137,9 @@ public: -using VolumeSyntaxDef = lib_composit::SeqsR, TokenRn, TokenR, +using VolumeSyntaxDef = lib_composit::SeqsR, TMate, TAct, lib_composit::OptMulti>, - TokenRn>; + TMate>; class VolumeSyntax : public ElementRule { public: VolumeSyntax() : ElementRule("volume_define") { } @@ -152,7 +152,7 @@ public: -using RankSyntaxDef = lib_composit::SeqsR, TokenRn, TokenR>; +using RankSyntaxDef = lib_composit::SeqsR, TMate, TAct>; class RankSyntax : public ElementRule { public: RankSyntax() : ElementRule("rank_define") { } diff --git a/libSyntax/syntax_templets.h b/libSyntax/syntax_templets.h index 45f351c..e01730f 100644 --- a/libSyntax/syntax_templets.h +++ b/libSyntax/syntax_templets.h @@ -48,9 +48,9 @@ namespace lib_composit { template p = nullptr> requires std::derived_from&& std::derived_from - class TokenR : public lib_syntax::TokenMatch { + class TAct : public lib_syntax::TokenMatch { public: - TokenR() : TokenMatch(std::make_shared()) { } + TAct() : TokenMatch(std::make_shared()) { } }; template requires std::derived_from @@ -59,5 +59,5 @@ namespace lib_composit { } template requires std::derived_from&& std::derived_from - class TokenRn : public TokenR { }; + class TMate : public TAct { }; } diff --git a/libSyntax/tokens_novel.cpp b/libSyntax/tokens_novel.cpp index 154113f..f008f06 100644 --- a/libSyntax/tokens_novel.cpp +++ b/libSyntax/tokens_novel.cpp @@ -134,17 +134,17 @@ int SplitMk::typeMark() const QString SplitMk::regex() const { return "&"; } -QString NameSection::reviseWords() const { return "名称"; } +QString NameText::reviseWords() const { return "名称"; } -int NameSection::typeMark() const +int NameText::typeMark() const { return 0x08000000; } -QString NameSection::regex() const { return "^([^\\{\\}@&]+)"; } +QString NameText::regex() const { return "^([^\\{\\}@&]+)"; } std::tuple, std::shared_ptr > -NameSection::analysis(std::shared_ptr content) const +NameText::analysis(std::shared_ptr content) const { auto text = content->content(); QRegExp regx(regex()); diff --git a/libSyntax/tokens_novel.h b/libSyntax/tokens_novel.h index 397dd84..c1d1fd7 100644 --- a/libSyntax/tokens_novel.h +++ b/libSyntax/tokens_novel.h @@ -91,7 +91,7 @@ namespace example_novel { }; - class LIBSYNTAX_EXPORT NameSection : public lib_token::ITokenProcess, public std::enable_shared_from_this { + class LIBSYNTAX_EXPORT NameText : public lib_token::ITokenProcess, public std::enable_shared_from_this { // TokenDefine interface public: virtual QString reviseWords() const override;