mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-10 19:33:11 +00:00
Some `\n's needed an extra level of escaping because they
Estimated hours taken: 0.2
Branches: main
extras/references/scoped_update.m:
Some `\n's needed an extra level of escaping because they
themselves appeared in escaped string literals. In at
least one case this caused a #define to break in the
generated .c file.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
%-----------------------------------------------------------------------------%
|
||||
% Copyright (C) 1998-1999,2002 University of Melbourne.
|
||||
% Copyright (C) 1998-1999,2002, 2004 The University of Melbourne.
|
||||
% This file may only be copied under the terms of the GNU Library General
|
||||
% Public License - see the file COPYING.LIB in the Mercury distribution.
|
||||
%-----------------------------------------------------------------------------%
|
||||
@@ -90,7 +90,7 @@ void ME_exit_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason);
|
||||
|
||||
#ifdef ME_DEBUG_SCOPE
|
||||
#define ME_show_handle(msg, handle) \
|
||||
printf(""%s <%5d, in: %5d, out: %5d\n"", (msg), \
|
||||
printf(""%s <%5d, in: %5d, out: %5d\\n"", (msg), \
|
||||
*(int *) (handle)->var, \
|
||||
(int) (handle)->insideval, \
|
||||
(int) (handle)->outsideval)
|
||||
@@ -112,7 +112,7 @@ ME_enter_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason)
|
||||
case MR_undo:
|
||||
case MR_retry:
|
||||
ME_untrail_msg(""ME_enter_scope_failing: ""
|
||||
""exception/undo/retry\n"");
|
||||
""exception/undo/retry\\n"");
|
||||
ME_show_handle(""=> fail back into scope. old: "",
|
||||
handle);
|
||||
handle->outsideval = *handle->var;
|
||||
@@ -122,7 +122,7 @@ ME_enter_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason)
|
||||
break;
|
||||
|
||||
default:
|
||||
ME_untrail_msg(""ME_enter_scope_failing: default\n"");
|
||||
ME_untrail_msg(""ME_enter_scope_failing: default\\n"");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@ ME_exit_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason)
|
||||
case MR_undo:
|
||||
case MR_retry:
|
||||
ME_untrail_msg(""ME_exit_scope_failing: ""
|
||||
""exception/undo/retry\n"");
|
||||
""exception/undo/retry\\n"");
|
||||
ME_show_handle(""<= fail back out of scope. old: "",
|
||||
handle);
|
||||
*handle->var = handle->outsideval;
|
||||
@@ -146,14 +146,14 @@ ME_exit_scope_failing(ME_ScopeHandle handle, MR_untrail_reason reason)
|
||||
case MR_commit:
|
||||
case MR_solve:
|
||||
ME_untrail_msg(""ME_exit_scope_failing: ""
|
||||
""commit/solve\n"");
|
||||
""commit/solve\\n"");
|
||||
/* This *may* help GC collect more garbage */
|
||||
handle->var = (MR_Word *) 0;
|
||||
handle->outsideval = handle->insideval = (MR_Word) 0;
|
||||
break;
|
||||
|
||||
default:
|
||||
ME_untrail_msg(""ME_exit_scope_failing: default\n"");
|
||||
ME_untrail_msg(""ME_exit_scope_failing: default\\n"");
|
||||
/* we may need to do something if reason == MR_gc */
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user