aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MoonParser/main.cpp')
-rw-r--r--MoonParser/main.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/MoonParser/main.cpp b/MoonParser/main.cpp
index 985fdcf..202a8df 100644
--- a/MoonParser/main.cpp
+++ b/MoonParser/main.cpp
@@ -50,7 +50,7 @@ struct Data
50rule Any = any(); 50rule Any = any();
51rule plain_space = *set(" \t"); 51rule plain_space = *set(" \t");
52rule Break = nl(-expr('\r') >> '\n'); 52rule Break = nl(-expr('\r') >> '\n');
53rule White = *(set(" \t\r") | Break); 53rule White = *(set(" \t") | Break);
54rule Stop = Break | eof(); 54rule Stop = Break | eof();
55rule Comment = "--" >> *(not_(set("\r\n")) >> Any) >> and_(Stop); 55rule Comment = "--" >> *(not_(set("\r\n")) >> Any) >> and_(Stop);
56rule Indent = *set(" \t"); 56rule Indent = *set(" \t");
@@ -556,12 +556,14 @@ rule BlockEnd = Block >> eof();
556#define AST_LEAF(type) \ 556#define AST_LEAF(type) \
557class type##_t : public ast_node \ 557class type##_t : public ast_node \
558{ \ 558{ \
559public: 559public: \
560 virtual int get_type() override { return ast_type<type##_t>(); }
560 561
561#define AST_NODE(type) \ 562#define AST_NODE(type) \
562class type##_t : public ast_container \ 563class type##_t : public ast_container \
563{ \ 564{ \
564public: 565public: \
566 virtual int get_type() override { return ast_type<type##_t>(); }
565 567
566#define AST_END(type) \ 568#define AST_END(type) \
567}; \ 569}; \
@@ -577,7 +579,6 @@ AST_LEAF(Num)
577 stream << static_cast<char>(*it); 579 stream << static_cast<char>(*it);
578 } 580 }
579 stream >> value; 581 stream >> value;
580 cout << value << '\n';
581 } 582 }
582AST_END(Num) 583AST_END(Num)
583 584