Commit 95173e4d57f2b6c31552955535f203d38208434f

Vivek Kumar Bansal 2015-02-13T22:52:05

fix merge conflict

diff --git a/components.js b/components.js
index 727ee23..71a7ce4 100644
--- a/components.js
+++ b/components.js
@@ -298,10 +298,15 @@ var components = {
 			"require": "javascript",
 			"owner": "vkbansal"
 		},
-		"stylus" : {
-			"title": "Stylus",
-			"owner": "vkbansal"
-		}
+		"fsharp": {
+			"title": "F#",
+			"require": "clike",
+			"owner": "simonreynolds7"
+		},
+        "stylus" : {
+            "title": "Stylus",
+            "owner": "vkbansal"
+        }
 	},
 	"plugins": {
 		"meta": {
@@ -326,7 +331,8 @@ var components = {
 		},
 		"highlight-keywords": {
 			"title": "Highlight Keywords",
-			"owner": "vkbansal"
+			"owner": "vkbansal",
+			"noCSS": true
 		}
 	}
 };
diff --git a/components/prism-csharp.js b/components/prism-csharp.js
index b196025..48f3025 100644
--- a/components/prism-csharp.js
+++ b/components/prism-csharp.js
@@ -2,5 +2,5 @@ Prism.languages.csharp = Prism.languages.extend('clike', {
 	'keyword': /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/g,
 	'string': /@?("|')(\\?.)*?\1/g,
 	'preprocessor': /^\s*#.*/gm,
-	'number': /\b-?(0x)?\d*\.?\d+\b/g
+	'number': /\b-?(0x[\da-f]+|\d*\.?\d+)\b/ig
 });
diff --git a/components/prism-csharp.min.js b/components/prism-csharp.min.js
index eab8b6e..0a67512 100644
--- a/components/prism-csharp.min.js
+++ b/components/prism-csharp.min.js
@@ -1 +1 @@
-Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/g,string:/@?("|')(\\?.)*?\1/g,preprocessor:/^\s*#.*/gm,number:/\b-?(0x)?\d*\.?\d+\b/g});
\ No newline at end of file
+Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/g,string:/@?("|')(\\?.)*?\1/g,preprocessor:/^\s*#.*/gm,number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/gi});
\ No newline at end of file
diff --git a/components/prism-fsharp.js b/components/prism-fsharp.js
new file mode 100644
index 0000000..c4768cf
--- /dev/null
+++ b/components/prism-fsharp.js
@@ -0,0 +1,16 @@
+Prism.languages.fsharp = Prism.languages.extend('clike', {
+	'comment': [
+		{
+			pattern: /(^|[^\\])\(\*[\w\W]*?\*\)/g,
+			lookbehind: true
+		},
+		{
+			pattern: /(^|[^\\:])\/\/.*/g,
+			lookbehind: true
+		}
+	],
+	'keyword': /\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|let|let!|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|then|to|true|try|type|upcast|use|use!|val|void|when|while|with|yield|yield!|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/g,
+	'string': /@?("""|"|')((\\|\n)?.)*?\1B?/g,
+	'preprocessor': /^\s*#.*/gm,
+	'number': [ /\b-?0x[\da-fA-F]+(un|lf|LF)?\b/g, /\b-?0b[01]+(y|uy)?\b/g, /\b-?(\d+\.|\d*\.?\d+)([fFmM]|[eE][+-]?\d+)?\b/g, /\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/g ]
+});
\ No newline at end of file
diff --git a/components/prism-fsharp.min.js b/components/prism-fsharp.min.js
new file mode 100644
index 0000000..548c828
--- /dev/null
+++ b/components/prism-fsharp.min.js
@@ -0,0 +1 @@
+Prism.languages.fsharp=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\(\*[\w\W]*?\*\)/g,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/g,lookbehind:!0}],keyword:/\b(abstract|and|as|assert|base|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|global|if|in|inherit|inline|interface|internal|lazy|let|let!|match|member|module|mutable|namespace|new|not|null|of|open|or|override|private|public|rec|return|return!|select|static|struct|then|to|true|try|type|upcast|use|use!|val|void|when|while|with|yield|yield!|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall|trait|virtual|volatile)\b/g,string:/@?("""|"|')((\\|\n)?.)*?\1B?/g,preprocessor:/^\s*#.*/gm,number:[/\b-?0x[\da-fA-F]+(un|lf|LF)?\b/g,/\b-?0b[01]+(y|uy)?\b/g,/\b-?(\d+\.|\d*\.?\d+)([fFmM]|[eE][+-]?\d+)?\b/g,/\b-?\d+(y|uy|s|us|l|u|ul|L|UL|I)?\b/g]});
\ No newline at end of file
diff --git a/examples/prism-fsharp.html b/examples/prism-fsharp.html
new file mode 100644
index 0000000..cf76552
--- /dev/null
+++ b/examples/prism-fsharp.html
@@ -0,0 +1,103 @@
+<h1>F#</h1>
+<p>To use this language, use the class "language-fsharp".</p>
+
+<h2>Comments</h2>
+<pre><code>// Single line comment
+(* Multi-line
+comment *)</code></pre>
+
+<h2>Strings</h2>
+<pre><code>"foo \"bar\" baz"
+'foo \'bar\' baz'
+@"Verbatim strings"
+"""Alternate "verbatim" strings"""
+</code></pre>
+
+<h2>Numbers</h2>
+<pre><code>
+//8 bit Int
+86y
+0b00000101y
+//Unsigned 8 bit Int
+86uy
+0b00000101uy
+//16 bit Int
+86s
+//Unsigned 16 bit Int
+86us
+//Int
+86
+86l
+0b10000
+0x2A6
+//Unsigned Int
+86u
+86ul
+//unativeint
+0x00002D3Fun
+//Long
+86L
+//Unsigned Long
+86UL
+//Float
+4.14F
+4.14f
+4.f
+4.F
+0x0000000000000000lf
+//Double
+4.14
+2.3E+32
+2.3e+32
+2.3e-32
+2.3e32
+0x0000000000000000LF
+//BigInt
+9999999999999999999999999999I
+//Decimal
+0.7833M
+0.7833m
+3.m
+3.M
+</code></pre>
+
+<h2>Full example</h2>
+<pre><code>// The declaration creates a constructor that takes two values, name and age. 
+type Person(name:string, age:int) =
+    // A Person object's age can be changed. The mutable keyword in the 
+    // declaration makes that possible. 
+    let mutable internalAge = age
+
+    // Declare a second constructor that takes only one argument, a name. 
+    // This constructor calls the constructor that requires two arguments, 
+    // sending 0 as the value for age. 
+    new(name:string) = Person(name, 0)
+
+    // A read-only property. 
+    member this.Name = name
+    // A read/write property. 
+    member this.Age
+        with get() = internalAge
+        and set(value) = internalAge &lt;- value
+
+    // Instance methods. 
+    // Increment the person's age. 
+    member this.HasABirthday () = internalAge &lt;- internalAge + 1
+
+    // Check current age against some threshold. 
+    member this.IsOfAge targetAge = internalAge &gt;= targetAge
+
+    // Display the person's name and age. 
+    override this.ToString () = 
+        "Name:  " + name + "\n" + "Age:   " + (string)internalAge
+</code></pre>
+
+<h2>Known failures</h2>
+<p>There are certain edge cases where Prism will fail.
+	There are always such cases in every regex-based syntax highlighter.
+	However, Prism dares to be open and honest about them.
+	If a failure is listed here, it doesn’t mean it will never be fixed. This is more of a “known bugs” list, just with a certain type of bug.
+</p>
+
+<h3>Comment-like substrings</h3>
+<pre><code>"foo (* bar *) baz"; "foo // bar";</code></pre>
\ No newline at end of file