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);
|
||||
}
|
||||
|
||||
public bool Equals(LuaString s)
|
||||
private bool Equals(LuaString s)
|
||||
{
|
||||
if (s == null) return false;
|
||||
return string.Equals(s.Value, Value);
|
||||
return s != null && string.Equals(s.Value, Value);
|
||||
}
|
||||
|
||||
public static LuaString operator +(LuaString a, LuaType b)
|
||||
|
|
|
@ -141,7 +141,7 @@ namespace Upsilon.Parser
|
|||
{
|
||||
var start = _position;
|
||||
var sb = new StringBuilder();
|
||||
while (true)
|
||||
while (_position < _text.Length)
|
||||
{
|
||||
_position++;
|
||||
if (Current == '"')
|
||||
|
@ -149,8 +149,6 @@ namespace Upsilon.Parser
|
|||
sb.Append(Current);
|
||||
}
|
||||
|
||||
_position++;
|
||||
|
||||
var res = sb.ToString();
|
||||
return new SyntaxToken(SyntaxKind.String, start, $"\"{res}\"", res);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue