diff options
author | 2018-05-24 07:32:52 -0700 | |
---|---|---|
committer | 2018-05-24 07:33:48 -0700 | |
commit | 17f8d4e5a36f5c4bd020ce9163f5b1db62679e2c (patch) | |
tree | 9b065d3c27259a5da38563fcda505c3f7002275c /src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java | |
parent | 2a6051b0c74ce59e30522fbd509ccbb460289df7 (diff) |
Reject files when the first line is indented.
A bug in the lexer ignored indentation on the first line of a file. This now
causes an error.
Also, remove the COMMENT token from the lexer. Comments are now accessed separately. This will allow further optimizations in the lexer. It also aligns the code a bit more with the Go implementation.
RELNOTES[INC]:
Indentation on the first line of a file was previously ignored. This is now fixed.
PiperOrigin-RevId: 197889775
Diffstat (limited to 'src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java')
-rw-r--r-- | src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java b/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java index a69563a73f..1ee0dff026 100644 --- a/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java +++ b/src/test/java/com/google/devtools/build/lib/syntax/EvaluationTest.java @@ -467,9 +467,9 @@ public class EvaluationTest extends EvaluationTestCase { .testStatement("[ ] * 10", MutableList.empty()) .testStatement("[1, 2] * 0", MutableList.empty()) .testStatement("[1, 2] * -4", MutableList.empty()) - .testStatement(" 2 * [1, 2]", MutableList.of(env, 1, 2, 1, 2)) + .testStatement("2 * [1, 2]", MutableList.of(env, 1, 2, 1, 2)) .testStatement("10 * []", MutableList.empty()) - .testStatement(" 0 * [1, 2]", MutableList.empty()) + .testStatement("0 * [1, 2]", MutableList.empty()) .testStatement("-4 * [1, 2]", MutableList.empty()); } @@ -484,9 +484,9 @@ public class EvaluationTest extends EvaluationTestCase { .testStatement("( ) * 10", Tuple.empty()) .testStatement("(1, 2) * 0", Tuple.empty()) .testStatement("(1, 2) * -4", Tuple.empty()) - .testStatement(" 2 * (1, 2)", Tuple.of(1, 2, 1, 2)) + .testStatement("2 * (1, 2)", Tuple.of(1, 2, 1, 2)) .testStatement("10 * ()", Tuple.empty()) - .testStatement(" 0 * (1, 2)", Tuple.empty()) + .testStatement("0 * (1, 2)", Tuple.empty()) .testStatement("-4 * (1, 2)", Tuple.empty()); } |