aboutsummaryrefslogtreecommitdiffhomepage
path: root/parse_constants.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-01 15:29:56 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-01 15:29:56 -0800
commitfb882f0b695d88a3211cdae97f18d955427b0b18 (patch)
tree8be6a6b1f55489165adeca0179bfc0a55cc936c1 /parse_constants.h
parent27cba56761de987c778937521987759475e27051 (diff)
Support for stack overflow and infinite recursion detection in new
parser
Diffstat (limited to 'parse_constants.h')
-rw-r--r--parse_constants.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/parse_constants.h b/parse_constants.h
index e923bc10..12fcb114 100644
--- a/parse_constants.h
+++ b/parse_constants.h
@@ -128,6 +128,8 @@ enum {
typedef unsigned int parser_test_error_bits_t;
+/** Maximum number of function calls. */
+#define FISH_MAX_STACK_DEPTH 128
/**
Error message for tokenizer error. The tokenizer message is
@@ -140,15 +142,15 @@ typedef unsigned int parser_test_error_bits_t;
*/
#define COND_ERR_MSG _( L"An additional command is required" )
-/**
- Error message on a function that calls itself immediately
-*/
+/** Error message on a function that calls itself immediately */
#define INFINITE_RECURSION_ERR_MSG _( L"The function calls itself immediately, which would result in an infinite loop.")
-/**
- Error message on reaching maximum recursion depth
-*/
-#define OVERFLOW_RECURSION_ERR_MSG _( L"Maximum recursion depth reached. Accidental infinite loop?")
+/** Error message on a function that calls itself immediately */
+#define INFINITE_FUNC_RECURSION_ERR_MSG _( L"The function '%ls' calls itself immediately, which would result in an infinite loop.")
+
+
+/** Error message on reaching maximum call stack depth */
+#define CALL_STACK_LIMIT_EXCEEDED_ERR_MSG _( L"The function call stack limit has been exceeded. Do you have an accidental infinite loop?")
/**
Error message used when the end of a block can't be located