fix { reader macro comment error
This commit is contained in:
@@ -77,14 +77,16 @@ class Reader {
|
|||||||
// Lets you construct key-value pairs for map literals or for-loops
|
// Lets you construct key-value pairs for map literals or for-loops
|
||||||
readTable["=>"] = (stream:Stream, k) -> KeyValueExp(assertRead(stream, k), assertRead(stream, k));
|
readTable["=>"] = (stream:Stream, k) -> KeyValueExp(assertRead(stream, k), assertRead(stream, k));
|
||||||
|
|
||||||
readTable[")"] = (stream:Stream, k) -> {
|
function unmatchedBracket(b:String) {
|
||||||
stream.putBackString(")");
|
readTable[b] = (stream:Stream, k) -> {
|
||||||
throw new UnmatchedBracketSignal(")", stream.position());
|
stream.putBackString(b);
|
||||||
};
|
throw new UnmatchedBracketSignal(b, stream.position());
|
||||||
readTable["]"] = (stream:Stream, k) -> {
|
|
||||||
stream.putBackString("]");
|
|
||||||
throw new UnmatchedBracketSignal("]", stream.position());
|
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
unmatchedBracket(")");
|
||||||
|
unmatchedBracket("]");
|
||||||
|
unmatchedBracket("}");
|
||||||
|
|
||||||
readTable["`"] = (stream:Stream, k) -> Quasiquote(assertRead(stream, k));
|
readTable["`"] = (stream:Stream, k) -> Quasiquote(assertRead(stream, k));
|
||||||
readTable[","] = (stream:Stream, k) -> Unquote(assertRead(stream, k));
|
readTable[","] = (stream:Stream, k) -> Unquote(assertRead(stream, k));
|
||||||
|
@@ -30,7 +30,11 @@
|
|||||||
rassert fluffers
|
rassert fluffers
|
||||||
(Assert.pass))
|
(Assert.pass))
|
||||||
|
|
||||||
(function _testCommentAtBlockEnd []
|
(function _testCommentAtBlockOrArrayEnd []
|
||||||
|
[
|
||||||
|
(+ 1 2)
|
||||||
|
// Comment
|
||||||
|
]
|
||||||
{
|
{
|
||||||
(+ 1 2)
|
(+ 1 2)
|
||||||
// Comment
|
// Comment
|
||||||
|
Reference in New Issue
Block a user