From 8d4e4c00257ece45fc5063a150978ad2192ca282 Mon Sep 17 00:00:00 2001 From: Jan Date: Tue, 19 Nov 2019 12:54:13 +0100 Subject: [PATCH] ZoneCodeGenerator: Fix | not being a recognized token of the lexer --- src/ZoneCodeGenerator/Parsing/Impl/Lexer.cs | 3 ++- test/ZoneCodeGeneratorTests/Parsing/Impl/LexerTest.cs | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ZoneCodeGenerator/Parsing/Impl/Lexer.cs b/src/ZoneCodeGenerator/Parsing/Impl/Lexer.cs index bcf7ba1b..6101ec6e 100644 --- a/src/ZoneCodeGenerator/Parsing/Impl/Lexer.cs +++ b/src/ZoneCodeGenerator/Parsing/Impl/Lexer.cs @@ -35,7 +35,8 @@ namespace ZoneCodeGenerator.Parsing.Impl '+', '-', '/', - '\\' + '\\', + '|' }; private readonly IParsingFileStream fileStream; diff --git a/test/ZoneCodeGeneratorTests/Parsing/Impl/LexerTest.cs b/test/ZoneCodeGeneratorTests/Parsing/Impl/LexerTest.cs index ac3cc44f..4032a885 100644 --- a/test/ZoneCodeGeneratorTests/Parsing/Impl/LexerTest.cs +++ b/test/ZoneCodeGeneratorTests/Parsing/Impl/LexerTest.cs @@ -65,6 +65,7 @@ namespace ZoneCodeGeneratorTests.Parsing.Impl "word1-word2- word3 - word4 -word5", "word1/word2/ word3 / word4 /word5", "word1\\word2\\ word3 \\ word4 \\word5", + "word1|word2| word3 | word4 |word5", }); AssertTokenOutput("word1", ";", "word2", ";", "word3", ";", "word4", ";", "word5"); @@ -90,6 +91,7 @@ namespace ZoneCodeGeneratorTests.Parsing.Impl AssertTokenOutput("word1", "-", "word2", "-", "word3", "-", "word4", "-", "word5"); AssertTokenOutput("word1", "/", "word2", "/", "word3", "/", "word4", "/", "word5"); AssertTokenOutput("word1", "\\", "word2", "\\", "word3", "\\", "word4", "\\", "word5"); + AssertTokenOutput("word1", "|", "word2", "|", "word3", "|", "word4", "|", "word5"); Assert.IsTrue(lexer.IsEndOfStream); }