Skip to content

Commit

Permalink
OS 2.3.11-rc
Browse files Browse the repository at this point in the history
+ improve error info: shows detailed compiler error if occur
  • Loading branch information
Evgeniy Golovin committed Sep 28, 2014
1 parent 3787714 commit 6262b99
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
27 changes: 26 additions & 1 deletion src/objectscript.cpp
Expand Up @@ -4114,7 +4114,32 @@ bool OS::Core::Compiler::compile()
break;

case ERROR_SYNTAX:
dump += OS_TEXT(" SYNTAX");
if(tokenizer->isError()){
OS_ASSERT(!error_token);
switch(tokenizer->getErrorCode()){
case Tokenizer::ERROR_MULTI_LINE_COMMENT: // multi line comment not end
dump += OS_TEXT(" TOKENIZER_MULTI_LINE_COMMENT");
break;

case Tokenizer::ERROR_CONST_STRING: // string not end
dump += OS_TEXT(" TOKENIZER_CONST_STRING");
break;

case Tokenizer::ERROR_CONST_STRING_ESCAPE_CHAR: // string escape error
dump += OS_TEXT(" TOKENIZER_CONST_STRING_ESCAPE_CHAR");
break;

default:
OS_ASSERT(false);
// no break

case Tokenizer::ERROR_SYNTAX:
dump += OS_TEXT(" TOKENIZER_SYNTAX");
break;
}
}else{
dump += OS_TEXT(" SYNTAX");
}
break;

case ERROR_NESTED_ROOT_BLOCK:
Expand Down
2 changes: 1 addition & 1 deletion src/objectscript.h
Expand Up @@ -71,7 +71,7 @@ inline void operator delete(void *, void *){}
#define OS_DEBUG_VERSION
#endif

#define OS_VERSION OS_TEXT("2.3.10-rc") OS_PLATFORM_BITS_VERSION OS_DEBUG_VERSION
#define OS_VERSION OS_TEXT("2.3.11-rc") OS_PLATFORM_BITS_VERSION OS_DEBUG_VERSION
#define OS_COPYRIGHT OS_TEXT("OS ") OS_VERSION OS_TEXT(" Copyright (C) 2012-2014 by Evgeniy Golovin")
#define OS_OPENSOURCE OS_TEXT("ObjectScript is free and open source: https://github.com/unitpoint/objectscript")

Expand Down

0 comments on commit 6262b99

Please sign in to comment.