Пример #1
0
 public ArrayTypeSyntax(TokenSyntax arrayToken, TokenSyntax leftBracket, TypeDescriptionSyntax valueType, TokenSyntax rightBracket)
 {
     ArrayToken   = arrayToken;
     LeftBracket  = leftBracket;
     ValueType    = valueType;
     RightBracket = rightBracket;
 }
        public void GivenTokenSyntaxWithTypeNotDefault_WhenInitialize_PropertiesShouldVerify()
        {
            const string testTokenValueText = "TokenText123";
            var          subject            = new TokenSyntax <SyntaxType>(testTokenValueText, SyntaxType.Two);

            subject.Token.Should().Be(testTokenValueText);
            subject.TokenType.Should().Be(SyntaxType.Two);
        }
Пример #3
0
 public WhileLoopSyntax(TokenSyntax whileToken, TokenSyntax leftParenToken, ExpressionSyntax condition, TokenSyntax rightParenToken, StatementSyntax body)
 {
     WhileToken      = whileToken;
     LeftParenToken  = leftParenToken;
     Condition       = condition;
     RightParenToken = rightParenToken;
     Body            = body;
 }
        public void GivenTokenSyntax_WhenInitialize_PropertiesVerified()
        {
            const string testTokenValueText = "TokenText";
            var          subject            = new TokenSyntax <SyntaxType>(testTokenValueText, SyntaxType.One);

            subject.Token.Should().Be(testTokenValueText);
            subject.TokenType.Should().Be(SyntaxType.One);
        }
Пример #5
0
        public IfStatementSyntax(TokenSyntax ifToken, TokenSyntax leftParenToken, ExpressionSyntax condition, TokenSyntax rightParenToken, StatementSyntax trueBranch, TokenSyntax elseToken, StatementSyntax falseBranch)
        {
            IfToken         = ifToken;
            LeftParenToken  = leftParenToken;
            Condition       = condition;
            RightParenToken = rightParenToken;
            TrueBranch      = trueBranch;
            ElseToken       = elseToken;
            FalseBranch     = falseBranch;

            if (ElseToken == null && FalseBranch == null)
            {
                Span = new TextSpan(IfToken.Span.Start, TrueBranch.Span.End);
            }
            else
            {
                Span = new TextSpan(IfToken.Span.Start, FalseBranch.Span.End);
            }
        }
Пример #6
0
        public ForLoopSyntax(

            TokenSyntax forToken,
            TokenSyntax leftParenToken,
            StatementSyntax assignment,
            TokenSyntax comma1,
            ExpressionSyntax condition,
            TokenSyntax comma2,
            ExpressionSyntax step,
            TokenSyntax rightParenToken,
            StatementSyntax body

            )
        {
            ForToken        = forToken;
            LeftParenToken  = leftParenToken;
            Assignment      = assignment;
            Comma1          = comma1;
            Condition       = condition;
            Comma2          = comma2;
            Step            = step;
            RightParenToken = rightParenToken;
            Body            = body;
        }
Пример #7
0
 public TypeDefinitionSyntax(TokenSyntax delimeterToken, SyntaxNode nameToken)
 {
     DelimeterToken  = delimeterToken;
     TypeDescription = nameToken;
 }
Пример #8
0
 public FunctionTypeSyntax(TupleTypeSyntax parameterSyntax, TokenSyntax delimeterToken, TypeDescriptionSyntax returnSyntax)
 {
     ParameterSyntax = parameterSyntax;
     DelimeterToken  = delimeterToken;
     ReturnSyntax    = returnSyntax;
 }
Пример #9
0
 public VariableDeclarationSyntax(TokenSyntax keywordToken, TypedIdentifierSyntax identifier, AssignmentExpressionSyntax initialiser)
 {
     KeywordToken = keywordToken;
     Identifier   = identifier;
     Initialiser  = initialiser;
 }
Пример #10
0
 public ValueTypeSyntax(TokenSyntax typeName)
 {
     TypeName = typeName;
 }
Пример #11
0
 public ContinueSyntax(TokenSyntax continueToken)
 {
     ContinueToken = continueToken;
 }
Пример #12
0
 public BlockSyntax(TokenSyntax leftBrace, ImmutableArray <StatementSyntax> statements, TokenSyntax rightBrace)
 {
     LeftBrace  = leftBrace;
     Statements = statements;
     RightBrace = rightBrace;
 }
Пример #13
0
 public ReturnSyntax(TokenSyntax returnToken, ExpressionSyntax expression)
 {
     ReturnToken = returnToken;
     Expression  = expression;
 }
Пример #14
0
 public TupleTypeSyntax(TokenSyntax leftParen, SeperatedSyntaxList <SyntaxNode> types, TokenSyntax rightParen)
 {
     LeftParen  = leftParen;
     Types      = types;
     RightParen = rightParen;
 }
Пример #15
0
 public TypedIdentifierSyntax(TokenSyntax identifier, TypeDefinitionSyntax definition)
 {
     IdentifierName = identifier;
     Definition     = definition;
 }
Пример #16
0
 public BreakSyntax(TokenSyntax breakToken)
 {
     BreakToken = breakToken;
 }