Skip to content

Commit

Permalink
Add token parsing for ':' character
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed Jan 22, 2022
1 parent 6880cce commit 2075a36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
6 changes: 1 addition & 5 deletions EOBot/Interpreter/BotTokenParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,6 @@ public BotToken GetNextToken()
? BotTokenType.Keyword
: BotTokenType.Label;

if (type == BotTokenType.Label && (char)_inputStream.Peek() == ':')
{
Read();
}

return new BotToken(type, identifier);
}
else if (char.IsDigit(inputChar))
Expand All @@ -120,6 +115,7 @@ public BotToken GetNextToken()
case '}': return new BotToken(BotTokenType.RBrace, inputChar.ToString());
case '[': return new BotToken(BotTokenType.LBracket, inputChar.ToString());
case ']': return new BotToken(BotTokenType.RBracket, inputChar.ToString());
case ':': return new BotToken(BotTokenType.Colon, inputChar.ToString());
case '"':
{
var stringLiteral = string.Empty;
Expand Down
1 change: 1 addition & 0 deletions EOBot/Interpreter/BotTokenType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public enum BotTokenType
RBrace,
LBracket,
RBracket,
Colon,
Keyword,
Identifier,
Label,
Expand Down

0 comments on commit 2075a36

Please sign in to comment.