Quantcast
Viewing all articles
Browse latest Browse all 20

New Post: This is a great plugin; here's the F# formatter

namespace CodeSnippet.Formats {
/// <summary>
/// Generates color-coded HTML 4.01 from F# source code.
/// </summary>
public class FSharpFormat : CLikeFormat {
#region Properties
/// <summary>
/// The list of F# keywords.
/// </summary>
protected override string Keywords {
get {
return "abstract and as assert asr begin class default delegate do done downcast "
+ "downto else end enum exception false finally for fun function if in inherit "
+ "interface land lazy let lor lsl lsr lxor match member mod module mutable namespace "
+ "new null of open or override rec sig static struct then to true try type "
+ "val when inline upcast while with -> <- "
+ "async atomic break checked component const constraint constructor continue decimal "
+ "eager event external fixed functor include method mixin object "
+ "process property protected public pure readonly return sealed switch virtual "
+ "void volatile";
}
}
/// <summary>
/// The list of F# preprocessors.
/// </summary>
protected override string Preprocessors {
get {
return "#I #if #import #light #load #nowarn #quit #r #time #types #use";
}
}
/// <summary>
/// Regular expression string to match single line and multi-line
/// comments // and (* *).
/// </summary>
protected override string CommentRegex {
get { return @"\(\*.*?\*\)|//.*?(?=\r|\n)"; }
}
#endregion Properties
}
}

Viewing all articles
Browse latest Browse all 20

Trending Articles