From f3e1186a87b12f1e75a0690351f5b9a2b822d0c3 Mon Sep 17 00:00:00 2001 From: micttyl <109993301+micttyl@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:24:58 -0700 Subject: [PATCH] Fix for Minor Style Issue: a non-auto method to auto (#2166) Minor Style Change: a non-auto method to auto Change the comment to address the correct function name Sort the Members of `TokenizedBuffer` according to the YAML format Fix to have the preferred term, `nul` over `null` Include the library of the added function in carbon-language#2030 --- toolchain/lexer/tokenized_buffer.h | 8 ++++---- toolchain/source/source_buffer.cpp | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/toolchain/lexer/tokenized_buffer.h b/toolchain/lexer/tokenized_buffer.h index a9c5c059edb2..6d891ab9b763 100644 --- a/toolchain/lexer/tokenized_buffer.h +++ b/toolchain/lexer/tokenized_buffer.h @@ -227,7 +227,7 @@ class TokenizedBuffer { // If true, the value is mantissa * 10^exponent. [[nodiscard]] auto IsDecimal() const -> bool { return is_decimal_; } - void Print(llvm::raw_ostream& output_stream) const { + auto Print(llvm::raw_ostream& output_stream) const -> void { output_stream << Mantissa() << "*" << (is_decimal_ ? "10" : "2") << "^" << Exponent(); } @@ -351,7 +351,7 @@ class TokenizedBuffer { // line-oriented shell tools from `grep` to `awk`. auto Print(llvm::raw_ostream& output_stream) const -> void; - // Prints a description of a single token. See `print` for details on the + // Prints a description of a single token. See `Print` for details on the // format. auto PrintToken(llvm::raw_ostream& output_stream, Token token) const -> void; @@ -400,8 +400,8 @@ class TokenizedBuffer { int index; int kind; - int column; int line; + int column; int indent; }; @@ -440,7 +440,7 @@ class TokenizedBuffer { int64_t start; // The byte length of the line. Does not include the newline character (or a - // null terminator or EOF). + // nul-terminator or EOF). int32_t length; // The byte offset from the start of the line of the first non-whitespace diff --git a/toolchain/source/source_buffer.cpp b/toolchain/source/source_buffer.cpp index b7dad7c8a397..539e9dca7993 100644 --- a/toolchain/source/source_buffer.cpp +++ b/toolchain/source/source_buffer.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "common/check.h"