private string ScanDirectiveName(Mark start)
{
var name = new StringBuilder();
// Consume the directive name.
while (analyzer.IsAlphaNumericDashOrUnderscore())
{
name.Append(ReadCurrentCharacter());
}
// Check if the name is empty.
if (name.Length == 0)
{
throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a directive, could not find expected directive name.");
}
// Check for an blank character after the name.
if (!analyzer.IsWhiteBreakOrZero())
{
throw new SyntaxErrorException(start, cursor.Mark(), "While scanning a directive, find unexpected non-alphabetical character.");
}
return name.ToString();
}