Revisión | 130519fe65a1ca30febaf958c841c56e7e714dae (tree) |
---|---|
Tiempo | 2018-11-16 23:33:51 |
Autor | dhrname <dhrname@user...> |
Commiter | dhrname |
Modify the ST_parse function
@@ -474,9 +474,6 @@ ST_Node ST_parse(ST_Token_Mode *array, size_t length, ST_Ordered_Pair *list) | ||
474 | 474 | |
475 | 475 | /*変数seqが空ノードに初期化されるので、この変数にキャッシュしておく*/ |
476 | 476 | ST_Node seq_cache = ST_createNode(ST_EMPTY_NODE); |
477 | - | |
478 | - /*seqをルートノードの末子ノードとして初期化*/ | |
479 | - seq = ST_insertBefore(seq, ST_createNode(ST_EMPTY_NODE), ST_EMPTY_NODE); | |
480 | 477 | |
481 | 478 | for (int_fast32_t i=length-1; i>=0; i--) |
482 | 479 | { |
@@ -289,12 +289,12 @@ int main(int argc, char **argv) | ||
289 | 289 | varlist = ST_tokenize(u8"aBa愛", tokens1); |
290 | 290 | assert(ST_isEmptyNode(ST_parse(tokens1, length, varlist))); |
291 | 291 | ST_freelist(varlist); |
292 | - /* | |
292 | + | |
293 | 293 | ST_Token_Mode tokens2[7] = {0}; |
294 | 294 | init_token(tokens2); |
295 | 295 | length = sizeof(tokens2) / sizeof(tokens2[0]); |
296 | 296 | varlist = ST_tokenize(u8"(愛あ)(愛)", tokens2); |
297 | - assert(ST_isEmpty(ST_parse(tokens2, length, varlist))); | |
297 | + assert(ST_isEmptyNode(ST_parse(tokens2, length, varlist))); | |
298 | 298 | assert(ST_first(ST_second(varlist)) != ST_first(varlist)); |
299 | 299 | ST_freelist(varlist); |
300 | 300 | init_token(tokens2); |
@@ -303,14 +303,14 @@ int main(int argc, char **argv) | ||
303 | 303 | tokens2[5] = 0; |
304 | 304 | tokens2[6] = 0; |
305 | 305 | varlist = ST_tokenize(u8"「愛あ」(愛)", tokens2); |
306 | - assert(!ST_isEmpty(ST_parse(tokens2, length, varlist))); | |
306 | + assert(!ST_isEmptyNode(ST_parse(tokens2, length, varlist))); | |
307 | 307 | assert(ST_first(ST_second(varlist)) == ST_first(varlist)); |
308 | 308 | ST_freelist(varlist); |
309 | - | |
309 | + /* | |
310 | 310 | ST_Token_Mode tokens3[12] = {0}; |
311 | 311 | length = sizeof(tokens3) / sizeof(tokens3[0]); |
312 | 312 | varlist = ST_tokenize(u8"「愛「愛」(愛)」(愛)", tokens3); |
313 | - assert(!ST_isEmpty(ST_parse(tokens3, length, varlist))); | |
313 | + assert(!ST_isEmptyNode(ST_parse(tokens3, length, varlist))); | |
314 | 314 | assert(ST_first(ST_second(varlist)) != ST_first(varlist)); |
315 | 315 | assert(ST_getItem(varlist, 1) != ST_first(varlist)); |
316 | 316 | assert(ST_getItem(varlist, 0) == ST_first(varlist)); |
@@ -319,7 +319,7 @@ int main(int argc, char **argv) | ||
319 | 319 | ST_Token_Mode tokens4[12] = {0}; |
320 | 320 | length = sizeof(tokens4) / sizeof(tokens4[0]); |
321 | 321 | varlist = ST_tokenize(u8"「愛」(愛)「愛」(愛)", tokens4); |
322 | - assert(!ST_isEmpty(ST_parse(tokens4, length, varlist))); | |
322 | + assert(!ST_isEmptyNode(ST_parse(tokens4, length, varlist))); | |
323 | 323 | assert(ST_first(ST_second(varlist)) == ST_first(varlist)); |
324 | 324 | assert(ST_getItem(varlist, 2) != ST_first(varlist)); |
325 | 325 | assert(ST_getItem(varlist, 3) != ST_first(varlist)); |
@@ -330,7 +330,7 @@ int main(int argc, char **argv) | ||
330 | 330 | ST_Token_Mode tokens5[12] = {0}; |
331 | 331 | length = sizeof(tokens5) / sizeof(tokens5[0]); |
332 | 332 | varlist = ST_tokenize(u8"「謎」(謎)「愛」(愛)", tokens5); |
333 | - assert(!ST_isEmpty(ST_parse(tokens5, length, varlist))); | |
333 | + assert(!ST_isEmptyNode(ST_parse(tokens5, length, varlist))); | |
334 | 334 | assert(ST_first(ST_second(varlist)) == ST_first(varlist)); |
335 | 335 | assert(ST_getItem(varlist, 2) != ST_first(varlist)); |
336 | 336 | assert(ST_getItem(varlist, 3) != ST_first(varlist)); |