Skip to content

Commit b697e6d

Browse files
improve invalid first token error
1 parent 6cb72dd commit b697e6d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Code/ContextSystem/Contexter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ List<Context> contexts
133133

134134
if (firstToken is not IContextableToken contextable)
135135
{
136-
return rs + "The beginning of the line is incorrectly strucutred.";
136+
return rs + $"{firstToken} is not a valid way to start a line. Maybe you made a typo?";
137137
}
138138

139139
var context = contextable.GetContext(scr);

Code/TokenSystem/Tokens/BaseToken.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public string GetBestTextRepresentation(Script? script)
6868

6969
public override string ToString()
7070
{
71-
return GetType().AccurateName;
71+
return $"token '{RawRep}' ({GetType().AccurateName})";
7272
}
7373

7474
public TryGet<T> TryGetLiteralValue<T>() where T : LiteralValue

0 commit comments

Comments
 (0)