浏览代码

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
micttyl 3 年之前
父节点
当前提交
f3e1186a87
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 4 4
      toolchain/lexer/tokenized_buffer.h
  2. 1 0
      toolchain/source/source_buffer.cpp

+ 4 - 4
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

+ 1 - 0
toolchain/source/source_buffer.cpp

@@ -13,6 +13,7 @@
 #include <cstdint>
 #include <limits>
 #include <system_error>
+#include <utility>
 #include <variant>
 
 #include "common/check.h"