コード例 #1
0
        private static bool GetCompiledNameValue(IFSharpAttribute attr, out string compiledName)
        {
            // todo: proper expressions evaluation, e.g. "S1" + "S2"
            if (!attr.ShortNameEquals(CompiledName) || attr.ArgExpression.String == null)
            {
                compiledName = null;
                return(false);
            }

            compiledName =
                attr.ArgExpression.String.GetText()
                .Substring(1, attr.ArgExpression.String.GetText().Length - 2)
                .SubstringBeforeLast("`", StringComparison.Ordinal);
            return(true);
        }
コード例 #2
0
 public static bool ShortNameEquals([NotNull] this IFSharpAttribute attr, [NotNull] string shortName) =>
 attr.LongIdentifier?.Name.GetAttributeShortName()?.Equals(shortName, StringComparison.Ordinal) ?? false;
コード例 #3
0
 private static bool IsModuleSuffixAttribute([NotNull] this IFSharpAttribute attr) =>
 attr.ShortNameEquals("CompilationRepresentation") &&
 attr.ArgExpression.LongIdentifier?.QualifiedName == ModuleSuffix;
コード例 #4
0
 public static bool ShortNameEquals([NotNull] this IFSharpAttribute attr, [NotNull] string shortName) =>
 attr.GetShortName() == shortName;
コード例 #5
0
 public static string GetShortName([NotNull] this IFSharpAttribute attr) =>
 attr.LongIdentifier?.Name.GetAttributeShortName();
コード例 #6
0
 public static bool ShortNameEquals([NotNull] this IFSharpAttribute attr, [NotNull] string shortName) =>
 attr.LongIdentifier?.Name.GetAttributeShortName() == shortName;
コード例 #7
0
 private static bool IsModuleSuffixAttribute([NotNull] this IFSharpAttribute attr) =>
 attr.ShortNameEquals("CompilationRepresentation") && IsModuleSuffixExpr(attr.Expression);