aboutsummaryrefslogtreecommitdiff
path: root/MoonParser/ast.hpp
diff options
context:
space:
mode:
authorLi Jin <dragon-fly@qq.com>2019-09-17 00:41:21 +0800
committerLi Jin <dragon-fly@qq.com>2019-09-17 00:41:21 +0800
commit74c4f6eab47f76b093e17f515204525e00a3b352 (patch)
treed737b1437f103842f30c96a2787468d474405efb /MoonParser/ast.hpp
parentb65798d7960d797f2b7074c4cc47b8c70a9f5270 (diff)
downloadyuescript-74c4f6eab47f76b093e17f515204525e00a3b352.tar.gz
yuescript-74c4f6eab47f76b093e17f515204525e00a3b352.tar.bz2
yuescript-74c4f6eab47f76b093e17f515204525e00a3b352.zip
completing spec/class.moon
Diffstat (limited to 'MoonParser/ast.hpp')
-rw-r--r--MoonParser/ast.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/MoonParser/ast.hpp b/MoonParser/ast.hpp
index d239eac..e7ae74f 100644
--- a/MoonParser/ast.hpp
+++ b/MoonParser/ast.hpp
@@ -367,13 +367,20 @@ public:
367 clear(); 367 clear();
368 } 368 }
369 369
370 void add(ast_node* node) { 370 void push_back(ast_node* node) {
371 if (accept(node)) { 371 if (accept(node)) {
372 m_objects.push_back(node); 372 m_objects.push_back(node);
373 node->retain(); 373 node->retain();
374 } 374 }
375 } 375 }
376 376
377 void push_front(ast_node* node) {
378 if (accept(node)) {
379 m_objects.push_front(node);
380 node->retain();
381 }
382 }
383
377 const container& objects() const { 384 const container& objects() const {
378 return m_objects; 385 return m_objects;
379 } 386 }