• Michiel Verloop's avatar
    Refactor ctinfo.c to rely on ctformatting.h + various improvements. · bd2eff1c
    Michiel Verloop authored
    • Refactor ctinfo.c to rely on ctformatting.h.
      ○ Decouple various calls to ctformatting.h using macros.
      ○ Remove ProcessMessage, Loc2buf, PrintMessage, FinalizeMessageBegin and FinalizeMessage.
      ○ Refactor CTIerrorBegin/Continued/End.
        - Refactored calling locations to properly make use of these functions.
      ○ Remove CTIwarnContinued (Had no uses and CTIwarnBegin/End did not yet exist).
      ○ Add CTIerrorRaw as a companion function to CTIgetErrorMessageVA.
        - Refactored calling locations of CTIgetErrorMessageVA to use CTIerrorRaw when printing output.
    • Add sac2cShared as a dependency for base-test-environment to avoid linking before types_nodetype.h is generated.
    • Add SBUFprintd function variant that deallocates the string argument.
    • Fix TYextendBottomError adding a newline if the error message to concatenate is null.
    • Refactor errors in type_errors.c to make use of str_buffer.h.
      - This also fixes two memory leaks.
    • Remove all sources of '@' characters in strings where they were used as newlines.
    • Refactor all sinks of '@' characters to instead consume newlines.
      ○ An exception is in ctformatting.c, because the source of the @ character is a compiler argument and cannot generate newlines.
    • Remove outdated README from the tests/errors folder (An updated README exists in the tests folder).
    • Refactor error end-to-end tests.
      ○ Add Mac compatibility - the tests no longer make use of the -P flag which BSD grep does not support.
      ○ Remove the case insensitive flags.
    • Rename test-type_inference_error.sac to test-type-inference-error.sac.
    • Rename test-overload_error.sac to test-overload-error.sac.
    • Rename function CTFvcreateMessageLoc to CTFvCreateMessageLoc.