*polished code.

This commit is contained in:
paladin-t 2015-12-28 11:43:29 +08:00
parent 43a521e74b
commit a191979da7
13 changed files with 18 additions and 17 deletions

View File

@ -1,5 +1,6 @@
Dec. 28 2015 Dec. 28 2015
Improved threshold algorithm for the memory pool Improved threshold algorithm for the memory pool
Polished code
Dec. 25 2015 Dec. 25 2015
Added support to put a class instance into a variable Added support to put a class instance into a variable

View File

@ -1,6 +1,6 @@
The MIT License The MIT License
Copyright (C) 2011 - 2015 Wang Renxin Copyright (C) 2011 - 2016 Wang Renxin
Permission is hereby granted, free of charge, to any person obtaining a copy of Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in this software and associated documentation files (the "Software"), to deal in

View File

@ -1,6 +1,6 @@
<img src="resource/icon.ico" width="64"> <img src="resource/icon.ico" width="64">
**Copyright (C) 2011 - 2015 [Wang Renxin](https://cn.linkedin.com/pub/wang-renxin/43/494/20). All rights reserved.** **Copyright (C) 2011 - 2016 [Wang Renxin](https://cn.linkedin.com/pub/wang-renxin/43/494/20). All rights reserved.**
Why are existing script interpreters so complex? Why is it so difficult to integrate with them? Why not try MY-BASIC today! Script should be simple and enjoyable. Why are existing script interpreters so complex? Why is it so difficult to integrate with them? Why not try MY-BASIC today! Script should be simple and enjoyable.

View File

@ -3,7 +3,7 @@
** **
** For the latest info, see https://github.com/paladin-t/my_basic/ ** For the latest info, see https://github.com/paladin-t/my_basic/
** **
** Copyright (C) 2011 - 2015 Wang Renxin ** Copyright (C) 2011 - 2016 Wang Renxin
** **
** Permission is hereby granted, free of charge, to any person obtaining a copy of ** Permission is hereby granted, free of charge, to any person obtaining a copy of
** this software and associated documentation files (the "Software"), to deal in ** this software and associated documentation files (the "Software"), to deal in
@ -84,7 +84,7 @@ extern "C" {
/** Macros */ /** Macros */
#define _VER_MAJOR 1 #define _VER_MAJOR 1
#define _VER_MINOR 1 #define _VER_MINOR 1
#define _VER_REVISION 110 #define _VER_REVISION 111
#define _VER_SUFFIX #define _VER_SUFFIX
#define _MB_VERSION ((_VER_MAJOR * 0x01000000) + (_VER_MINOR * 0x00010000) + (_VER_REVISION)) #define _MB_VERSION ((_VER_MAJOR * 0x01000000) + (_VER_MINOR * 0x00010000) + (_VER_REVISION))
#define _STRINGIZE(A) _MAKE_STRINGIZE(A) #define _STRINGIZE(A) _MAKE_STRINGIZE(A)
@ -6983,7 +6983,7 @@ void _tidy_intermediate_value(_ref_t* ref, void* data) {
mb_make_nil(ref->s->running_context->intermediate_value); mb_make_nil(ref->s->running_context->intermediate_value);
break; break;
default: default: /* Do nothing */
break; break;
} }
} }
@ -7091,7 +7091,7 @@ _retry:
result = _core_call(s, (void**)(&ast)); result = _core_call(s, (void**)(&ast));
break; break;
default: default: /* Do nothing */
break; break;
} }
@ -7640,7 +7640,7 @@ int mb_init(void) {
_exp_assign->data.func = (_func_t*)mb_malloc(sizeof(_func_t)); _exp_assign->data.func = (_func_t*)mb_malloc(sizeof(_func_t));
memset(_exp_assign->data.func, 0, sizeof(_func_t)); memset(_exp_assign->data.func, 0, sizeof(_func_t));
_exp_assign->data.func->name = (char*)mb_malloc(strlen("#") + 1); _exp_assign->data.func->name = (char*)mb_malloc(strlen("#") + 1);
memcpy(_exp_assign->data.func->name, "#\0", strlen("#") + 1); memcpy(_exp_assign->data.func->name, "#", strlen("#") + 1);
_exp_assign->data.func->pointer = _core_dummy_assign; _exp_assign->data.func->pointer = _core_dummy_assign;
mb_assert(!_OBJ_BOOL_TRUE); mb_assert(!_OBJ_BOOL_TRUE);
@ -10826,7 +10826,7 @@ _retry:
ast = ast->prev; ast = ast->prev;
break; break;
default: default: /* Do nothing */
break; break;
} }

View File

@ -3,7 +3,7 @@
** **
** For the latest info, see https://github.com/paladin-t/my_basic/ ** For the latest info, see https://github.com/paladin-t/my_basic/
** **
** Copyright (C) 2011 - 2015 Wang Renxin ** Copyright (C) 2011 - 2016 Wang Renxin
** **
** Permission is hereby granted, free of charge, to any person obtaining a copy of ** Permission is hereby granted, free of charge, to any person obtaining a copy of
** this software and associated documentation files (the "Software"), to deal in ** this software and associated documentation files (the "Software"), to deal in

Binary file not shown.

View File

@ -57,7 +57,7 @@
VALUE "FileDescription", "MY-BASIC Interpreter for Windows" VALUE "FileDescription", "MY-BASIC Interpreter for Windows"
VALUE "FileVersion", "1, 1, 0, 0" VALUE "FileVersion", "1, 1, 0, 0"
VALUE "InternalName", "my_basic" VALUE "InternalName", "my_basic"
VALUE "LegalCopyright", "Copyright (C) 2011 - 2015 Wang Renxin" VALUE "LegalCopyright", "Copyright (C) 2011 - 2016 Wang Renxin"
VALUE "LegalTrademarks", "MY-BASIC" VALUE "LegalTrademarks", "MY-BASIC"
VALUE "OriginalFilename", "my_basic.exe" VALUE "OriginalFilename", "my_basic.exe"
VALUE "ProductName", "MY-BASIC" VALUE "ProductName", "MY-BASIC"

View File

@ -1,5 +1,5 @@
' This script is an example of MY-BASIC ' This script is an example of MY-BASIC
' Copyright (c) 2011 - 2015 Wang Renxin. All rights reserved. ' Copyright (c) 2011 - 2016 Wang Renxin. All rights reserved.
' For more information, see https://github.com/paladin-t/my_basic/ ' For more information, see https://github.com/paladin-t/my_basic/
s$ = "hello " s$ = "hello "

View File

@ -1,5 +1,5 @@
' This script is an example of MY-BASIC ' This script is an example of MY-BASIC
' Copyright (c) 2011 - 2015 Wang Renxin. All rights reserved. ' Copyright (c) 2011 - 2016 Wang Renxin. All rights reserved.
' For more information, see https://github.com/paladin-t/my_basic/ ' For more information, see https://github.com/paladin-t/my_basic/
e = 50 e = 50

View File

@ -1,5 +1,5 @@
' This script is an example of MY-BASIC ' This script is an example of MY-BASIC
' Copyright (c) 2011 - 2015 Wang Renxin. All rights reserved. ' Copyright (c) 2011 - 2016 Wang Renxin. All rights reserved.
' For more information, see https://github.com/paladin-t/my_basic/ ' For more information, see https://github.com/paladin-t/my_basic/
print "Input: " print "Input: "

View File

@ -1,5 +1,5 @@
' This script is an example of MY-BASIC ' This script is an example of MY-BASIC
' Copyright (c) 2011 - 2015 Wang Renxin. All rights reserved. ' Copyright (c) 2011 - 2016 Wang Renxin. All rights reserved.
' For more information, see https://github.com/paladin-t/my_basic/ ' For more information, see https://github.com/paladin-t/my_basic/
begin: begin:

View File

@ -1,5 +1,5 @@
' This script is an example of MY-BASIC ' This script is an example of MY-BASIC
' Copyright (c) 2011 - 2015 Wang Renxin. All rights reserved. ' Copyright (c) 2011 - 2016 Wang Renxin. All rights reserved.
' For more information, see https://github.com/paladin-t/my_basic/ ' For more information, see https://github.com/paladin-t/my_basic/
def area(a, b) def area(a, b)

View File

@ -3,7 +3,7 @@
** **
** For the latest info, see https://github.com/paladin-t/my_basic/ ** For the latest info, see https://github.com/paladin-t/my_basic/
** **
** Copyright (C) 2011 - 2015 Wang Renxin ** Copyright (C) 2011 - 2016 Wang Renxin
** **
** Permission is hereby granted, free of charge, to any person obtaining a copy of ** Permission is hereby granted, free of charge, to any person obtaining a copy of
** this software and associated documentation files (the "Software"), to deal in ** this software and associated documentation files (the "Software"), to deal in
@ -657,7 +657,7 @@ static void _kill_program(const char* path) {
static void _show_tip(void) { static void _show_tip(void) {
_printf("MY-BASIC Interpreter Shell - %s\n", mb_ver_string()); _printf("MY-BASIC Interpreter Shell - %s\n", mb_ver_string());
_printf("Copyright (C) 2011 - 2015 Wang Renxin. All Rights Reserved.\n"); _printf("Copyright (C) 2011 - 2016 Wang Renxin. All Rights Reserved.\n");
_printf("For more information, see https://github.com/paladin-t/my_basic/.\n"); _printf("For more information, see https://github.com/paladin-t/my_basic/.\n");
_printf("Input HELP and hint enter to view help information.\n"); _printf("Input HELP and hint enter to view help information.\n");
} }