progress
This commit is contained in:
parent
16e76d6b31
commit
484dbfc9d9
529 changed files with 113694 additions and 0 deletions
53
AspClassic.Parser/ExitStatement.cs
Normal file
53
AspClassic.Parser/ExitStatement.cs
Normal file
|
@ -0,0 +1,53 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace AspClassic.Parser;
|
||||
|
||||
/// <summary>
|
||||
/// A parse tree for an Exit statement.
|
||||
/// </summary>
|
||||
public sealed class ExitStatement : Statement
|
||||
{
|
||||
private readonly BlockType _ExitType;
|
||||
|
||||
private readonly Location _ExitArgumentLocation;
|
||||
|
||||
/// <summary>
|
||||
/// The type of tree this statement exits.
|
||||
/// </summary>
|
||||
public BlockType ExitType => _ExitType;
|
||||
|
||||
/// <summary>
|
||||
/// The location of the exit statement type.
|
||||
/// </summary>
|
||||
public Location ExitArgumentLocation => _ExitArgumentLocation;
|
||||
|
||||
/// <summary>
|
||||
/// Constructs a parse tree for an Exit statement.
|
||||
/// </summary>
|
||||
/// <param name="exitType">The type of tree this statement exits.</param>
|
||||
/// <param name="exitArgumentLocation">The location of the exit statement type.</param>
|
||||
/// <param name="span">The location of the parse tree.</param>
|
||||
/// <param name="comments">The comments for the parse tree.</param>
|
||||
public ExitStatement(BlockType exitType, Location exitArgumentLocation, Span span, IList<Comment> comments)
|
||||
: base(TreeType.ExitStatement, span, comments)
|
||||
{
|
||||
switch (exitType)
|
||||
{
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException("exitType");
|
||||
case BlockType.None:
|
||||
case BlockType.Do:
|
||||
case BlockType.For:
|
||||
case BlockType.While:
|
||||
case BlockType.Select:
|
||||
case BlockType.Try:
|
||||
case BlockType.Sub:
|
||||
case BlockType.Function:
|
||||
case BlockType.Property:
|
||||
_ExitType = exitType;
|
||||
_ExitArgumentLocation = exitArgumentLocation;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue