PageRenderTime 1149ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/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
Possible License(s): GPL-2.0, MPL-2.0-no-copyleft-exception, CPL-1.0, CC-BY-SA-3.0, BSD-3-Clause, ISC, AGPL-3.0, LGPL-2.1, Apache-2.0
  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. using System.Collections.Generic;
  16. using System.Diagnostics;
  17. using Microsoft.Scripting;
  18. using Microsoft.Scripting.Utils;
  19. namespace IronRuby.Compiler.Ast {
  20. // when <expressions>, *<array>: <body>
  21. public partial class WhenClause : Node {
  22. [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2105:ArrayFieldsShouldNotBeReadOnly")]
  23. public static readonly WhenClause[] EmptyArray = new WhenClause[0];
  24. private readonly Expression/*!*/[]/*!*/ _comparisons;
  25. private readonly Statements _statements; // optional
  26. public Statements Statements {
  27. get { return _statements; }
  28. }
  29. public Expression/*!*/[]/*!*/ Comparisons {
  30. get { return _comparisons; }
  31. }
  32. public WhenClause(Expression/*!*/[] comparisons, Statements statements, SourceSpan location)
  33. : base(location) {
  34. _comparisons = comparisons ?? Expression.EmptyArray;
  35. _statements = statements;
  36. }
  37. }
  38. }