Compare commits

...

9 Commits

Author SHA1 Message Date
0x4261756D f301a663f3 Remove throwing part of tokenizerString test 2024-03-19 20:30:51 +01:00
0x4261756D 5b3da8b4b7 Merge branch 'csharp' of https://gittea.dev/0x4261756D/luaaaaah into csharp 2024-03-19 20:29:23 +01:00
0x4261756D f1f658169e Add empty string test 2024-03-19 20:28:36 +01:00
0x4261756D 23199d37f3 Remove throwing part of tokenizerString test 2024-03-19 20:26:51 +01:00
0x4261756D 5de6233436 Update launch.json 2024-03-19 20:26:38 +01:00
0x4261756D e89625c2e9 Throw on hex floats 2024-03-19 20:26:24 +01:00
0x4261756D 501bc9eed6 Fix crash on empty string 2024-03-19 20:25:58 +01:00
0x4261756D a4d9e5023f Fix error message 2024-03-19 20:24:40 +01:00
0x4261756D f310882220 Remove unnecessary setting of currentToken 2024-03-19 20:23:08 +01:00
4 changed files with 14 additions and 9 deletions

4
.vscode/launch.json vendored
View File

@ -11,7 +11,7 @@
"preLaunchTask": "build",
// If you have changed target frameworks, make sure to update the program path.
"program": "${workspaceFolder}/bin/Debug/net8.0/luaaaaah.dll",
"args": ["test/simpleString.lua"],
"args": ["run", "test/stringDataNotSet.lua"],
"cwd": "${workspaceFolder}",
// For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console
"console": "internalConsole",
@ -23,4 +23,4 @@
"request": "attach"
}
]
}
}

View File

@ -265,14 +265,12 @@ class Tokenizer
break;
case '"':
{
currentToken = null;
state = State.Quote;
currentToken = new(region: new(start: new(currentLocation), end: new(currentLocation)), type: TokenType.StringLiteral);
}
break;
case '\'':
{
currentToken = null;
state = State.SingleQuote;
currentToken = new(region: new(start: new(currentLocation), end: new(currentLocation)), type: TokenType.StringLiteral);
}
@ -319,6 +317,7 @@ class Tokenizer
{
currentToken.type = TokenType.StringLiteral;
currentToken.region.end = new(currentLocation);
currentToken.data ??= new Token.StringData("");
}
}
else
@ -400,7 +399,7 @@ class Tokenizer
case 'x':
{
state = State.QuoteBackslashX;
throw new NotImplementedException($"\\u escape sequences are broken right now");
throw new NotImplementedException($"\\x escape sequences are broken right now");
}
case 'u':
{
@ -515,7 +514,7 @@ class Tokenizer
{
currentToken.type = TokenType.StringLiteral;
currentToken.region.end = new(currentLocation);
currentToken.data = new Token.StringData("");
currentToken.data ??= new Token.StringData("");
}
}
else
@ -823,6 +822,10 @@ class Tokenizer
AppendDataIntHex(ch);
state = State.HexNumber;
}
else if(ch == '.')
{
throw new NotImplementedException($"{currentLocation}: Hex floats at are not implemented");
}
else
{
BacktrackNoTypeChange();
@ -842,6 +845,10 @@ class Tokenizer
currentToken!.type = TokenType.Numeral;
AppendDataIntHex(ch);
}
else if(ch == '.')
{
throw new NotImplementedException($"{currentLocation}: Hex floats at are not implemented");
}
else
{
BacktrackNoTypeChange();

View File

@ -0,0 +1 @@
local smt = getmetatable("")

View File

@ -8,6 +8,3 @@
abc" "123" "sdlfkgj<3" "asldkfj" zzz "" "" "" "" "" "fasd!" "afd" "" "as" zzzz
"\xf7\xAff\x43"
"\u{fa4}\u{1234}\u{12000}\u{123}"