parse_and_lex_context.cpp 743 B

123456789101112131415
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. #include "executable_semantics/syntax/parse_and_lex_context.h"
  5. // Writes a syntax error diagnostic, containing message, for the input file at
  6. // the given line, to standard error.
  7. auto Carbon::ParseAndLexContext::PrintDiagnostic(const std::string& message,
  8. int line_num) -> void {
  9. // TODO: Do we really want this to be fatal? It makes the comment and the
  10. // name a lie, and renders some of the other yyparse() result propagation code
  11. // moot.
  12. FATAL_COMPILATION_ERROR(line_num) << message;
  13. }