docs parsing
This commit is contained in:
@@ -37,14 +37,14 @@ public class Parser
|
||||
List<Modifier> modifiers = [];
|
||||
|
||||
List<string> documentationParts = [];
|
||||
while (_index < _tokens.Count && _tokens[_index] is CommentToken commentToken)
|
||||
while (_index < _tokens.Count && _tokens[_index] is DocumentationToken commentToken)
|
||||
{
|
||||
documentationParts.Add(commentToken.Comment);
|
||||
documentationParts.Add(commentToken.Documentation);
|
||||
_index++;
|
||||
}
|
||||
|
||||
|
||||
var documentation = documentationParts.Count == 0 ? null : string.Join('\n', documentationParts);
|
||||
|
||||
|
||||
while (TryExpectModifier(out var modifier))
|
||||
{
|
||||
modifiers.Add(modifier);
|
||||
@@ -570,11 +570,11 @@ public class Parser
|
||||
private Optional<Token> Peek()
|
||||
{
|
||||
var peekIndex = _index;
|
||||
while (peekIndex < _tokens.Count && _tokens[peekIndex] is CommentToken)
|
||||
while (peekIndex < _tokens.Count && _tokens[peekIndex] is DocumentationToken)
|
||||
{
|
||||
peekIndex++;
|
||||
}
|
||||
|
||||
|
||||
if (peekIndex < _tokens.Count)
|
||||
{
|
||||
return _tokens[peekIndex];
|
||||
@@ -585,11 +585,11 @@ public class Parser
|
||||
|
||||
private void Next()
|
||||
{
|
||||
while (_index < _tokens.Count && _tokens[_index] is CommentToken)
|
||||
while (_index < _tokens.Count && _tokens[_index] is DocumentationToken)
|
||||
{
|
||||
_index++;
|
||||
}
|
||||
|
||||
|
||||
_index++;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user