Revisão | 3ceee502b4704810abd2ff95514326cc1ddf20a2 (tree) |
---|---|
Hora | 2018-06-02 18:02:20 |
Autor | dhrname <dhrname@user...> |
Commiter | dhrname |
Modify the ST_parse function
@@ -482,8 +482,13 @@ ST_Binary_Tree ST_parse(ST_Token_Mode *array, size_t length, ST_Ordered_Pair *l | ||
482 | 482 | } |
483 | 483 | ST_freetree(bound_vstacklist); |
484 | 484 | ST_freetree(cache_nstacklist); |
485 | + | |
486 | + /*rseqはseqを逆向きにしたもの | |
487 | + * ST_reverseNode関数が新規ノードを返すためにこのような形になっている*/ | |
488 | + ST_Node rseq = ST_reverseNode(seq); | |
489 | + ST_freetree(seq); | |
485 | 490 | |
486 | - return seq; | |
491 | + return rseq; | |
487 | 492 | } |
488 | 493 | |
489 | 494 | /*ST_eval 関数 |
@@ -316,7 +316,7 @@ int main(int argc, char **argv) | ||
316 | 316 | varlist = ST_tokenize(u8"謎は「愛を愛する」(愛)", tokens5); |
317 | 317 | ST_Node btr = ST_parse(tokens5, length, varlist); |
318 | 318 | assert(ST_getBoundVariable(ST_getNodeValue(btr)) == ST_getItem(varlist, 0)); |
319 | - assert(ST_getNodeValue(ST_getPreviousNode(btr)) == ST_second(varlist)); | |
319 | + assert( ST_first(ST_getNodeValue(ST_getPreviousNode(btr))) == ST_getItem(varlist, 3) ); | |
320 | 320 | ST_freetree(btr); |
321 | 321 | ST_freelist(varlist); |
322 | 322 |