Fix error when character after string end
This commit is contained in:
parent
2baf2b223e
commit
46308557c8
|
@ -31,10 +31,9 @@ namespace Upsilon.BaseTypes
|
||||||
return (Value != null ? Value.GetHashCode() : 0);
|
return (Value != null ? Value.GetHashCode() : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Equals(LuaString s)
|
private bool Equals(LuaString s)
|
||||||
{
|
{
|
||||||
if (s == null) return false;
|
return s != null && string.Equals(s.Value, Value);
|
||||||
return string.Equals(s.Value, Value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LuaString operator +(LuaString a, LuaType b)
|
public static LuaString operator +(LuaString a, LuaType b)
|
||||||
|
|
|
@ -141,7 +141,7 @@ namespace Upsilon.Parser
|
||||||
{
|
{
|
||||||
var start = _position;
|
var start = _position;
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
while (true)
|
while (_position < _text.Length)
|
||||||
{
|
{
|
||||||
_position++;
|
_position++;
|
||||||
if (Current == '"')
|
if (Current == '"')
|
||||||
|
@ -149,8 +149,6 @@ namespace Upsilon.Parser
|
||||||
sb.Append(Current);
|
sb.Append(Current);
|
||||||
}
|
}
|
||||||
|
|
||||||
_position++;
|
|
||||||
|
|
||||||
var res = sb.ToString();
|
var res = sb.ToString();
|
||||||
return new SyntaxToken(SyntaxKind.String, start, $"\"{res}\"", res);
|
return new SyntaxToken(SyntaxKind.String, start, $"\"{res}\"", res);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue