Error Fixes
- Lexer discarding all newlines (now replaces it with spaces) - Cleanup of Type check and remove function in parser - Cleanup in Compiler.cs
This commit is contained in:
parent
4e4b31be3f
commit
d0c844972d
8 changed files with 198 additions and 146 deletions
|
|
@ -10,8 +10,8 @@ namespace Compiler.Lexer
|
|||
public List<Token> Lex(String inputString)
|
||||
{
|
||||
//strip newlines
|
||||
inputString = inputString.Replace("\n", "");
|
||||
inputString = inputString.Replace("\r", "");
|
||||
inputString = inputString.Replace("\n", " ");
|
||||
inputString = inputString.Replace("\r", " ");
|
||||
|
||||
//initialize Token List
|
||||
List<Token> tokens = new List<Token>();
|
||||
|
|
|
|||
|
|
@ -11,9 +11,11 @@ namespace Compiler.Lexer
|
|||
SemicolonToken,
|
||||
IdentifierToken,
|
||||
IntegerLiteralToken,
|
||||
|
||||
|
||||
//special Token to represent invalid matches
|
||||
InvalidToken
|
||||
|
||||
InvalidToken,
|
||||
|
||||
//empty toke
|
||||
NullToken
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue