Skip to content

Commit 63556f0

Browse files
committed
make getTokensForParser return non-const
since data is allocated with an appender that is not cleared, GC owns the memory and may be modified by the user if they wish to. Can still be used in all places where const was used before.
1 parent 885bc29 commit 63556f0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/dparse/lexer.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ public bool isLiteral(IdType type) pure nothrow @safe @nogc
555555
* `leadingTrivia` until there is the EOF, where it will be attached as
556556
* `trailingTrivia` again.
557557
*/
558-
const(Token)[] getTokensForParser(R)(R sourceCode, LexerConfig config, StringCache* cache)
558+
Token[] getTokensForParser(R)(R sourceCode, LexerConfig config, StringCache* cache)
559559
if (is(Unqual!(ElementEncodingType!R) : ubyte) && isDynamicArray!R)
560560
{
561561
config.whitespaceBehavior = WhitespaceBehavior.include;

0 commit comments

Comments
 (0)