• 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ón2302396c49906e3cf66ea4c34dec9d8a132c24a9 (tree)
Tiempo2021-11-15 23:00:18
Autordhrname <dhrname@joes...>
Commiterdhrname

Log Message

Test a jstr::IntegerTypeValue class

Cambiar Resumen

Diferencia incremental

Binary files a/bin/joestar.exe and b/bin/joestar.exe differ
Binary files a/bin/obj/main.o and b/bin/obj/main.o differ
--- a/main.cpp
+++ b/main.cpp
@@ -395,6 +395,11 @@ namespace jstr
395395 isSigned{b}
396396 {
397397 }
398+
399+ bool isUnsigned()
400+ {
401+ return !isSigned;
402+ }
398403 };
399404
400405 /*RealNumberTypeValue クラス
@@ -708,9 +713,11 @@ namespace jstr
708713 std::cout << lexer->YYText() << std::endl;
709714 break;
710715 case FLOAT:
716+ ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::RealNumberTypeValue(64)) );
711717 std::cout << lexer->YYText() << std::endl;
712718 break;
713719 case DOUBLE:
720+ ast = this->nest(ast, abstractSyntaxTreeRoot->makeNode(new jstr::RealNumberTypeValue(128)) );
714721 std::cout << lexer->YYText() << std::endl;
715722 break;
716723 case BOOLEAN:
@@ -989,13 +996,58 @@ int main(int argc, char **argv)
989996 delete includeFilephr;
990997 jstr::IntegerTypeValue* int08val = new jstr::IntegerTypeValue(8);
991998 EXPECT(int08val->timeIndex, 8);
999+ EXPECT(int08val->isUnsigned(), false);
9921000 delete int08val;
1001+ jstr::IntegerTypeValue* int16val = new jstr::IntegerTypeValue(16);
1002+ EXPECT(int16val->timeIndex, 16);
1003+ delete int16val;
1004+ jstr::IntegerTypeValue* int32val = new jstr::IntegerTypeValue(32);
1005+ EXPECT(int32val->timeIndex, 32);
1006+ delete int32val;
1007+ jstr::IntegerTypeValue* int64val = new jstr::IntegerTypeValue(64);
1008+ EXPECT(int64val->timeIndex, 64);
1009+ delete int64val; jstr::IntegerTypeValue* uint08val = new jstr::IntegerTypeValue(8, false);
1010+ EXPECT(uint08val->timeIndex, 8);
1011+ EXPECT(uint08val->isUnsigned(), true);
1012+ delete uint08val;
1013+ jstr::IntegerTypeValue* uint16val = new jstr::IntegerTypeValue(16);
1014+ EXPECT(uint16val->timeIndex, 16);
1015+ delete uint16val;
1016+ jstr::IntegerTypeValue* uint32val = new jstr::IntegerTypeValue(32);
1017+ EXPECT(uint32val->timeIndex, 32);
1018+ delete uint32val;
1019+ jstr::IntegerTypeValue* uint64val = new jstr::IntegerTypeValue(64);
1020+ EXPECT(uint64val->timeIndex, 64);
1021+ delete uint64val;
1022+ jstr::RealNumberTypeValue* real08val = new jstr::RealNumberTypeValue(8);
1023+ EXPECT(real08val->timeIndex, 8);
1024+ delete real08val;
1025+ jstr::RealNumberTypeValue* real16val = new jstr::RealNumberTypeValue(16);
1026+ EXPECT(real16val->timeIndex, 16);
1027+ delete real16val;
1028+ jstr::RealNumberTypeValue* real32val = new jstr::RealNumberTypeValue(32);
1029+ EXPECT(real32val->timeIndex, 32);
1030+ delete real32val;
1031+ jstr::RealNumberTypeValue* real64val = new jstr::RealNumberTypeValue(64);
1032+ EXPECT(real64val->timeIndex, 64);
1033+ delete real64val;
9931034 snet = nullptr;
9941035 snet2 = nullptr;
9951036 phr = nullptr;
9961037 metaphr = nullptr;
9971038 includeFilephr = nullptr;
9981039 int08val = nullptr;
1040+ int16val = nullptr;
1041+ int32val = nullptr;
1042+ int64val = nullptr;
1043+ uint08val = nullptr;
1044+ uint16val = nullptr;
1045+ uint32val = nullptr;
1046+ uint64val = nullptr;
1047+ real08val = nullptr;
1048+ real16val = nullptr;
1049+ real32val = nullptr;
1050+ real64val = nullptr;
9991051
10001052
10011053 llvm::LLVMContext context;