• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

programming language


Commit MetaInfo

Revisión6b5d6dc0e11943e1cb657de08cf11d6ac0195ae8 (tree)
Tiempo2021-11-09 22:54:30
Autordhrname <dhrname@joes...>
Commiterdhrname

Log Message

Modify the nest member function

Cambiar Resumen

Diferencia incremental

--- a/main.cpp
+++ b/main.cpp
@@ -27,6 +27,7 @@
2727 #include <cstdio>
2828 #include <fstream>
2929 #include <exception>
30+#include <vector>
3031 #include <iterator>
3132 #include "node.hpp"
3233 #include <FlexLexer.h>
@@ -503,7 +504,9 @@ namespace jstr
503504
504505 AbstractSyntaxTree()
505506 :spaceLength(0),
506- cacheSpaceLength(0),
507+ /*cacheSpaceLengthはspaceLengthと同じ値だと、
508+ * 一番初めのnestメンバ関数で失敗するので、spaceLengthより少ない値にしておく*/
509+ cacheSpaceLength(-1),
507510 vectorSpaceLength{0},
508511 abstractSyntaxTreeRoot{new jstr::root()}
509512 {
@@ -940,6 +943,7 @@ int main(int argc, char **argv)
940943 pa->parse(argv[1]);
941944 EXPECT(pa->getAbstractSyntaxTree()->isNode(), true);
942945 EXPECT(pa->getAbstractSyntaxTree()->getParent()->isNode(), false);
946+ EXPECT( pa->getAbstractSyntaxTree()->getFirstChild()->isCaseOf(typeid(jstr::SemanticNetwork*)), true );
943947 jstr::Parser* paa = new jstr::Parser();
944948 paa->parse("test/classtest.j");
945949 EXPECT(paa->getAbstractSyntaxTree()->isNode(), true);