Skip to content

Commit

Permalink
構文を表すノードのクラスにアクセス指定子をつけた
Browse files Browse the repository at this point in the history
  • Loading branch information
noya2ruler committed Jun 4, 2024
1 parent 84f41d0 commit 5fd19b1
Show file tree
Hide file tree
Showing 16 changed files with 21 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/syntax/CodeBlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ namespace almo {

// コードブロックを表すクラス. <div class="code-block"> タグで囲まれ、その中に <pre><code> タグが入る.
struct CodeBlock : public ASTNode {

private:
// コードの中身。
std::string code;

// Highlight.js によって正確にハイライトするために、言語を指定する必要がある。
// ```python -> python を持っておき、 `to_html` する際に <code class="language-python"> として出力する。
std::string language;

public:
CodeBlock(std::string code, std::string language) : code(code), language(language) {
set_uuid();
}
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/DivBlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace almo {
struct DivBlock : public ASTNode {
private:
std::string div_class;
public:
public:
DivBlock(std::string div_class) : div_class(div_class) {
set_uuid();
}
Expand Down
3 changes: 2 additions & 1 deletion src/syntax/Header.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
namespace almo {

struct Header : public ASTNode {

private:
int level;
public:
Header (int _level) : level(_level) {
set_uuid();
}
Expand Down
1 change: 1 addition & 0 deletions src/syntax/HorizontalLine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace almo {

struct HorizontalLine : public ASTNode {
public:
HorizontalLine() {
set_uuid();
}
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/InlineCodeBlock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace almo {

struct InlineCodeBlock : public ASTNode {

private:
std::string code;
public:
InlineCodeBlock(std::string code) : code(code) {
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/InlineImage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace almo {

struct InlineImage : public ASTNode {

private:
std::string url;
std::string caption;

Expand Down
2 changes: 1 addition & 1 deletion src/syntax/InlineItalic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace almo {

struct InlineItalic : public ASTNode {

public:
InlineItalic() {
set_uuid();
}
Expand Down
3 changes: 2 additions & 1 deletion src/syntax/InlineMath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
namespace almo {

struct InlineMath : public ASTNode {

private:
std::string expr;
public:
InlineMath (std::string _expr) : expr(_expr) {
set_uuid();
}
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/InlineOverline.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace almo {

struct InlineOverline : public ASTNode {

public:
InlineOverline() {
set_uuid();
}
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/InlineStrong.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace almo {

struct InlineStrong : public ASTNode {

public:
InlineStrong() {
set_uuid();
}
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/InlineUrl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace almo {

struct InlineUrl : public ASTNode {

private:
std::string url;
std::string alt;
public:
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/Markdown.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace almo {

struct Markdown : public ASTNode {

public:
Markdown () {
set_uuid();
}
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/NewLine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace almo {

struct NewLine : public ASTNode {

public:
NewLine () {
set_uuid();
}
Expand Down
1 change: 1 addition & 0 deletions src/syntax/Quote.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace almo {

// 引用を表すクラス
struct Quote : public ASTNode {
public:
Quote() {
set_uuid();
}
Expand Down
3 changes: 2 additions & 1 deletion src/syntax/RawText.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
namespace almo {

struct RawText : public ASTNode {

private:
std::string content;
public:
RawText(std::string _content) : content(_content) {
set_uuid();
}
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/Table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct Table : public ASTNode {
std::vector<std::string> col_names;
// 各列について、左寄せ(0), 中央寄せ(1), 右寄せ(2) のいずれかを指定する.
std::vector<int> col_format;
public:
public:
Table(std::vector<std::shared_ptr<Markdown>> columns, int n_row, int n_col, std::vector<std::string> col_names, std::vector<int> col_format) :
columns(columns), n_row(n_row), n_col(n_col), col_names(col_names), col_format(col_format) {
set_uuid();
Expand Down

0 comments on commit 5fd19b1

Please sign in to comment.