tests/accumulator/*.m:
tests/analysis_*/*.m:
tests/benchmarks*/*.m:
tests/debugger*/*.{m,exp,inp}:
tests/declarative_debugger*/*.{m,exp,inp}:
tests/dppd*/*.m:
tests/exceptions*/*.m:
tests/general*/*.m:
tests/grade_subdirs*/*.m:
tests/hard_coded*/*.m:
Make these tests use four-space indentation, and ensure that
each module is imported on its own line. (I intend to use the latter
to figure out which subdirectories' tests can be executed in parallel.)
These changes usually move code to different lines. For the debugger tests,
specify the new line numbers in .inp files and expect them in .exp files.
library/lexer.m:
Fix an old XXX: do not allow unterminated octal escapes in string
literals; we haven't needed to preserve bug-for-bug compatibility
with NU-Prolog for a very long time.
tests/hard_coded/special_char.m:
Terminate octal escapes.
tests/invalid/Mmakefile:
tests/invalid/unterminated_octal_escape.{m,err_exp}:
Check for an error if an unterminated octal escape is encountered.
Estimated hours taken: 2
Branches: main
Fix a bug where we were generating C code that contained special
characters in string literals. This generated code was relying on
the implementation-specific behaviour of GCC, and unfortunately
that behaviour changed in GCC versions 2.96 and later.
The symptom was that printing "\r\n" came out as "\n\n"
when using GCC versions >= 2.96.
compiler/c_util.m:
Change the code used to implement quote_char, quote_string,
and quote_multi_string so that these routines properly escape
all special characters, rather than just \" \' \n \b and \t.
(This required changing the output argument type for quote_char
from a character to a string.)
Add output_quoted_char, for use by layout_out.m.
compiler/layout_out.m:
Use c_util__output_quoted_char, rather than duplicating the
logic in c_util.m.
tests/hard_coded/Mmakefile:
tests/hard_coded/special_char.m:
tests/hard_coded/special_char.exp:
Regression test.
tests/hard_coded/Mmakefile:
tests/hard_coded/null_char.m:
tests/hard_coded/null_char.exp:
tests/hard_coded/null_char.exp2:
Add a test of outputting strings containing null characters.
Note that currently we don't handle this correctly;
we ignore everything after the first null character.
So the ".exp2" file for this test case allows that output.
If/when this is fixed, the ".exp2" file for this
test case should be removed.