Update error message for tabulations in source code. RELNOTES: None. PiperOrigin-RevId: 210117808
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/Lexer.java b/src/main/java/com/google/devtools/build/lib/syntax/Lexer.java index bcda4e3..5507053 100644 --- a/src/main/java/com/google/devtools/build/lib/syntax/Lexer.java +++ b/src/main/java/com/google/devtools/build/lib/syntax/Lexer.java
@@ -286,7 +286,7 @@ } else if (c == '\r') { pos++; } else if (c == '\t') { - error("Tabulations are not allowed for identation. Use spaces instead."); + error("Tab characters are not allowed for indentation. Use spaces instead."); indentLen++; pos++; } else if (c == '\n') { // entirely blank line: discard
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java b/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java index 379d955..33a66d1 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/LexerTest.java
@@ -380,7 +380,7 @@ @Test public void testIndentationWithTab() throws Exception { tokens("def x():\n\tpass"); - assertThat(lastError.toString()).contains("Tabulations are not allowed"); + assertThat(lastError).contains("Tab characters are not allowed"); } @Test