Browse Source

Fix: lexer string token

AnnulusGames 1 year ago
parent
commit
500629cadb
2 changed files with 1 additions and 1 deletions
  1. 0 1
      src/Lua/CodeAnalysis/Syntax/Lexer.cs
  2. 1 0
      tests/Lua.Tests/LexerTests.cs

+ 0 - 1
src/Lua/CodeAnalysis/Syntax/Lexer.cs

@@ -299,7 +299,6 @@ public ref struct Lexer
         {
         {
             var quote = c1;
             var quote = c1;
             var stringStartOffset = offset;
             var stringStartOffset = offset;
-            Advance(1);
 
 
             while (span.Length > offset)
             while (span.Length > offset)
             {
             {

+ 1 - 0
tests/Lua.Tests/LexerTests.cs

@@ -67,6 +67,7 @@ public class LexerTests
     }
     }
 
 
     [Test]
     [Test]
+    [TestCase("\"\"")]
     [TestCase("\"hello\"")]
     [TestCase("\"hello\"")]
     [TestCase("\"1.23\"")]
     [TestCase("\"1.23\"")]
     [TestCase("\"1-2-3-4-5\"")]
     [TestCase("\"1-2-3-4-5\"")]