PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/IronPython_Main/Languages/Ruby/Ruby/Compiler/Ast/Clauses/WhenClause.cs

#
C# | 45 lines | 23 code | 7 blank | 15 comment | 0 complexity | 3dcd4ed5aa52ab1e95eb243c5aaea9a3 MD5 | raw file
 1/* ****************************************************************************
 2 *
 3 * Copyright (c) Microsoft Corporation. 
 4 *
 5 * This source code is subject to terms and conditions of the Apache License, Version 2.0. A 
 6 * copy of the license can be found in the License.html file at the root of this distribution. If 
 7 * you cannot locate the  Apache License, Version 2.0, please send an email to 
 8 * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound 
 9 * by the terms of the Apache License, Version 2.0.
10 *
11 * You must not remove this notice, or any other, from this software.
12 *
13 *
14 * ***************************************************************************/
15
16using System.Collections.Generic;
17using System.Diagnostics;
18using Microsoft.Scripting;
19using Microsoft.Scripting.Utils;
20
21namespace IronRuby.Compiler.Ast {
22
23    //	when <expressions>, *<array>: <body>
24    public partial class WhenClause : Node {
25        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")]
26        public static readonly WhenClause[] EmptyArray = new WhenClause[0];
27
28        private readonly Expression/*!*/[]/*!*/ _comparisons;
29        private readonly Statements _statements;              // optional
30
31        public Statements Statements {
32            get { return _statements; }
33        }
34
35        public Expression/*!*/[]/*!*/ Comparisons {
36            get { return _comparisons; }
37        }
38
39        public WhenClause(Expression/*!*/[] comparisons, Statements statements, SourceSpan location)
40            : base(location) {
41            _comparisons = comparisons ?? Expression.EmptyArray;
42            _statements = statements;
43        }
44    }
45}