1
我想運行使用HWUT項目的文檔極簡主義迭代器示例,但在獲取以下錯誤。錯誤極簡主義迭代器示例HWUT
C:\hwut\demo\c\iterator\TEST>hwut gen test-it.c
Error: maker '<<hwut-file: ...>>' is ignored since version 0.20.4.
Error: use '-o file-stem' on command line instead.
Error: missing closing '|' for range. found ':'
它是這個例子的代碼:
#if 0
<<hwut-iterator: myIterator>>
<<hwut-file: myIterator>>
------------------------------------------------------------------------
#include <stdint.h>
------------------------------------------------------------------------
int Case; int x; int y;
0; |1:9:2|; |1:9:2|;
1; |0:10:2|; |0:10|;
------------------------------------------------------------------------
#endif
#include "hwut_unit.h"
#include "myIterator.h"
int main(int argc, char** argv)
{
myIterator_t it;
hwut_info("Check product of even and odd;");
myIterator_init(&it);
while(myIterator_next(&it)) {
if(it->Case == 0) {
// Odd x Odd == Odd
assert(my_product(it->x, it->y) % 2 != 0);
} else if(it->Case == 0) {
// Even x Anything == Even
assert(my_product(it->x, it->y) % 2 == 0);
assert(my_product(it->y, it->x) % 2 == 0);
}
}
}
有人能告訴我是什麼問題? 而且這個項目還支持嗎?否則,有人可以推薦我一個更大的支持類似的項目?
非常感謝
雖然這可能是一個有價值的提示來解決問題,但答案確實需要證明解決方案。請[編輯]提供示例代碼來展示你的意思。或者,可以考慮將其寫爲註釋。 –