exp comments
This commit is contained in:
@@ -56,7 +56,13 @@ class Reader {
|
||||
readTable["//"] = (stream:Stream, k) -> {
|
||||
stream.takeUntilAndDrop("\n");
|
||||
null;
|
||||
};
|
||||
// Special comment syntax that disables the next whole reader expression:
|
||||
readTable["**"] = (stream:Stream, k) -> {
|
||||
assertRead(stream, k);
|
||||
null;
|
||||
};
|
||||
|
||||
readTable["#|"] = (stream:Stream, k) -> RawHaxe(stream.expect("closing |#", () -> stream.takeUntilAndDrop("|#")));
|
||||
|
||||
readTable[":"] = (stream:Stream, k) -> TypedExp(nextToken(stream, "a type path"), assertRead(stream, k));
|
||||
|
@@ -318,6 +318,10 @@ class BasicTestCase extends Test {
|
||||
function testCountingLambda() {
|
||||
_testCountingLambda();
|
||||
}
|
||||
|
||||
function testExpComment() {
|
||||
_testExpComment();
|
||||
}
|
||||
}
|
||||
|
||||
class BasicObject {
|
||||
|
@@ -575,4 +575,7 @@
|
||||
(Assert.equals 1 (fullSyntax))
|
||||
(Assert.equals 2 (fullSyntax))
|
||||
(Assert.equals 1 (arrowSyntax))
|
||||
(Assert.equals 2 (arrowSyntax))))
|
||||
(Assert.equals 2 (arrowSyntax))))
|
||||
|
||||
(function _testExpComment []
|
||||
(Assert.equals 15 (+ **6 5 **(- 5 11) 5 (+ 5 **(20 9)))))
|
Reference in New Issue
Block a user