private static string LexMultiLineComment(TransactableTokenStream stream) { var comment = string.Empty; while (stream.Current != null && stream.Current != "*" && stream.Peek(1) != "/") { comment += stream.Current; stream.Consume(); } if (stream.Current == "*" && stream.Peek(1) == "/") { comment += stream.Current; stream.Consume(); comment += stream.Current; stream.Consume(); } return $"/*{comment}"; }
private static string LexSingleLineComment(TransactableTokenStream stream) { var comment = string.Empty; while (stream.Current != null && stream.Current != "\r" && stream.Peek(1) != "\n") { comment += stream.Current; stream.Consume(); } return $"//{comment}"; }