mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
* Include argument name in completion suggestions * Support optional args * It (not so shrimply) works * Add tests * Add TestGenericPipeInference * Fix tests * Release notes * Overzealous YAMLLinter * Improve help signatures, fix map command * Improve NoImplementationError * Better type argument help signatures * better pipe syntax * fix NRE * Add test * a * Fix silent toolshed failure * Fix GetConcreteMethodInternal * Improve vars command * EntProtoId IAsType * More GetConcreteMethodInternal fixes * I hate this so much * update tp command description The command arguments call the the "other" entity the "target" * Support localized argument hints/signatures
42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
using System.Text;
|
|
|
|
namespace Robust.Shared.Toolshed.Syntax;
|
|
|
|
public sealed partial class ParserContext
|
|
{
|
|
public bool NoMultilineExprs = false;
|
|
|
|
public static bool IsToken(Rune c) => Rune.IsLetterOrDigit(c) || c == new Rune('_');
|
|
|
|
public static bool IsCommandToken(Rune c)
|
|
{
|
|
if (Rune.IsLetterOrDigit(c))
|
|
return true;
|
|
|
|
if (Rune.IsWhiteSpace(c))
|
|
return false;
|
|
|
|
return c != new Rune('{')
|
|
&& c != new Rune('}')
|
|
&& c != new Rune('[')
|
|
&& c != new Rune(']')
|
|
&& c != new Rune('(')
|
|
&& c != new Rune(')')
|
|
&& c != new Rune('"')
|
|
&& c != new Rune('\'')
|
|
&& c != new Rune(':')
|
|
&& c != new Rune(';')
|
|
&& c != new Rune('|')
|
|
&& c != new Rune('$')
|
|
&& !Rune.IsControl(c);
|
|
}
|
|
|
|
public static bool IsNumeric(Rune c)
|
|
=>
|
|
IsToken(c)
|
|
|| c == new Rune('+')
|
|
|| c == new Rune('-')
|
|
|| c == new Rune('.')
|
|
|| c == new Rune('%');
|
|
}
|