-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes and enhancements #530
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
$CONSOLE:ONLY | ||
|
||
'interfacing internal variables | ||
DECLARE LIBRARY "errtest" | ||
FUNCTION GetErrorHistory$ | ||
FUNCTION GetErrorGotoLine& | ||
END DECLARE | ||
|
||
'testing handler behavior | ||
Status | ||
ON ERROR GOTO mainHandler | ||
Status | ||
ERROR 5 | ||
NormalTest | ||
ERROR 5 | ||
RecursiveTest 3 | ||
ERROR 5 | ||
ON ERROR GOTO _LASTHANDLER | ||
Status | ||
|
||
'return to test script | ||
SYSTEM | ||
|
||
'----------------------------------------------------------------------- | ||
mainHandler: | ||
PRINT " CALLED: main handler" | ||
RESUME NEXT | ||
'----- | ||
nSubHandler: | ||
PRINT " CALLED: normal sub handler" | ||
RESUME NEXT | ||
'----- | ||
rSubHandler: | ||
PRINT " CALLED: recursive sub handler" | ||
RESUME NEXT | ||
|
||
'----------------------------------------------------------------------- | ||
SUB NormalTest | ||
ON ERROR GOTO nSubHandler | ||
Status | ||
ERROR 5 | ||
ON ERROR GOTO _LASTHANDLER | ||
Status | ||
END SUB | ||
'----- | ||
SUB RecursiveTest (n%) | ||
ON ERROR GOTO rSubHandler | ||
Status | ||
ERROR 5 | ||
IF n% > 1 THEN RecursiveTest n% - 1 | ||
ON ERROR GOTO _LASTHANDLER | ||
Status | ||
END SUB | ||
|
||
'----------------------------------------------------------------------- | ||
SUB Status | ||
PRINT: PRINT "HISTORY: "; "<"; GetErrorHistory$; ">" | ||
SELECT CASE GetErrorGotoLine& | ||
CASE 0: PRINT " ACTIVE: unhandled" | ||
CASE 1: PRINT " ACTIVE: main handler" | ||
CASE 2: PRINT " ACTIVE: normal sub handler" | ||
CASE 3: PRINT " ACTIVE: recursive sub handler" | ||
END SELECT | ||
END SUB | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
unsigned char cont[256]; | ||
|
||
unsigned char *GetErrorHistory() { | ||
memset(cont, 0, 256); | ||
memcpy (cont, error_handler_history -> chr, error_handler_history -> len); | ||
return cont; | ||
} | ||
|
||
uint32_t GetErrorGotoLine() { | ||
return error_goto_line; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
HISTORY: <> | ||
ACTIVE: unhandled | ||
|
||
HISTORY: < 0|> | ||
ACTIVE: main handler | ||
CALLED: main handler | ||
|
||
HISTORY: < 1| 0|> | ||
ACTIVE: normal sub handler | ||
CALLED: normal sub handler | ||
|
||
HISTORY: < 0|> | ||
ACTIVE: main handler | ||
CALLED: main handler | ||
|
||
HISTORY: < 1| 0|> | ||
ACTIVE: recursive sub handler | ||
CALLED: recursive sub handler | ||
|
||
HISTORY: < 3| 1| 0|> | ||
ACTIVE: recursive sub handler | ||
CALLED: recursive sub handler | ||
|
||
HISTORY: < 3| 3| 1| 0|> | ||
ACTIVE: recursive sub handler | ||
CALLED: recursive sub handler | ||
|
||
HISTORY: < 3| 1| 0|> | ||
ACTIVE: recursive sub handler | ||
|
||
HISTORY: < 1| 0|> | ||
ACTIVE: recursive sub handler | ||
|
||
HISTORY: < 0|> | ||
ACTIVE: main handler | ||
CALLED: main handler | ||
|
||
HISTORY: <> | ||
ACTIVE: unhandled |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than a
qbs
could you use astd::stack<uint32_t>
? It seems like that's what you're created andstd::stack
would avoid all the string manipulation.