Sha256: 1273b50cce237f0362660fb0f727c5184246f82689c45f624786f6d23cb87d89

Contents?: true

Size: 1.48 KB

Versions: 35

Compression:

Stored size: 1.48 KB

Contents

using System;

namespace Demo.Ns
{
  /// sample class
  public class ClassSample : Base
  {
    /* sample multiline comment */
#region region sample
    fieldSample : int;
#endregion

    public virtual someMethod(str : string) : list[double]
    {
      def x = "simple string";
      def x = $"simple $splice string $(spliceMethod() + 1)";
      def x = <#
        recursive <# string #> sample
      #>;
      def x = $<#
        recursive $splice <# string #> sample
        ..$(lst; "; "; x => $"x * 2 = $(x * 2)") str
      #>;
      def x = @"somestring \";

      def localFunc(arg)
      {
         arg + 1;
      }

      match (localFunc(2))
      {
        | 3 => "ok";
        | _ => "fail";
      }

      using (x = SomeObject())
      {
        foreach (item in someCollection)
        {
          def i = try
          {
            int.Parse(item)
          }
          catch
          {
            | _ is FormatException => 0;
          }
          when (i > 0xff)
            unless (i < 555L)
              WriteLine(i);
          
        }
      }
      protected override overrideSample() : void
      {}

      private privateSample() : void
      {}

      public abstract abstractSample() : void
      {}
    }

  }

  module ModuleSample
  {
  }

  variant RgbColor {
   | Red
   | Yellow
   | Green
   | Different {
       red : float;
       green : float;
       blue : float;
     }
  }

  macro sampleMacro(expr)
  syntax ("write", expr)
  {
    <[ WriteLine($(expr : dyn)) ]>
  }
}

Version data entries

35 entries across 35 versions & 5 rubygems

Version Path
pygments.rb-0.3.6 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.3.5 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.3.4 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.3.3 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.3.2 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.3.1 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.3.0 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.13 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.12 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.11 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.10 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.9 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.8 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.7 vendor/pygments-main/tests/examplefiles/nemerle_sample.n
pygments.rb-0.2.6 vendor/pygments-main/tests/examplefiles/nemerle_sample.n