- 
                Notifications
    You must be signed in to change notification settings 
- Fork 25
Description
In Token.cs at line 417:
TypeCobol/TypeCobol/Compiler/Scanner/Token.cs
Line 417 in 8312290
| public static Token END_OF_FILE = new Token(TokenType.EndOfFile, 0, -1, TypeCobol.Compiler.Scanner.TokensLine.CreateVirtualLineForInsertedToken(-1, String.Empty)); | 
A Token instance should not be shared amongst several documents, each source file must get its own end-of-file token.
Besides, depending on how the token is used, it may retain large amount of data through its TokenSource and this could cause memory leaks.
- Track every usage of the shared token and update accordingly
- compare to TokenType.EndOfFileinstead of comparing to the instance
- create a new instance when needed
 
- compare to