Example #1
0
 // returns the lineID for this statement if it has one
 // otherwise returns null
 // takes in a hashtag block which it handles here
 // may need to be changed as future hashtags get support
 internal string GetLineID(YarnSpinnerParser.Hashtag_blockContext context)
 {
     // if there are any hashtags
     if (context != null)
     {
         foreach (var hashtag in context.hashtag())
         {
             string tagText = hashtag.GetText().Trim('#');
             if (tagText.StartsWith("line:", StringComparison.InvariantCulture))
             {
                 return(tagText);
             }
         }
     }
     return(null);
 }
 // returns the lineID for this statement if it has one
 // otherwise returns null
 // takes in a hashtag block which it handles here
 // may need to be changed as future hashtags get support
 internal string GetLineID(YarnSpinnerParser.Hashtag_blockContext context)
 {
     // if there are any hashtags
     if (context != null)
     {
         foreach (var hashtag in context.hashtag())
         {
             string tagText = hashtag.GetText().Trim('#');
             if (tagText.StartsWith("line:"))
             {
                 return tagText;
             }
         }
     }
     return null;
 }
 /// <summary>
 /// Visit a parse tree produced by <see cref="YarnSpinnerParser.hashtag_block"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitHashtag_block([NotNull] YarnSpinnerParser.Hashtag_blockContext context)
 {
     return(VisitChildren(context));
 }
Example #4
0
 /// <summary>
 /// Exit a parse tree produced by <see cref="YarnSpinnerParser.hashtag_block"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitHashtag_block([NotNull] YarnSpinnerParser.Hashtag_blockContext context)
 {
 }