Commit eba7177122202174aff428a84e248849f6e6b6fc

Simon Reynolds 2015-02-08T13:17:02

Reversing change in examples.js, simplifying regexes and expanding numbers section in example per suggestion

diff --git a/components/prism-fsharp.js b/components/prism-fsharp.js
index 09072df..e8ed152 100644
--- a/components/prism-fsharp.js
+++ b/components/prism-fsharp.js
@@ -10,20 +10,20 @@ Prism.languages.fsharp = Prism.languages.extend('clike', {
 		}
 	],
 	'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)?.)*?\1(B)?/g,
+	'string': /@?("""|"|')((\\|\n)?.)*?\1B?/g,
 	'preprocessor': /^\s*#.*/gm,
 	'number': [
 		{
-			pattern: /\b-?(0x((\d*)|([a-fA-F]*))*(un|LF)?)\b/g
+			pattern: /\b-?(0x[\da-fA-F]*.(un|LF)?)\b/g
 		},
 		{
-			pattern: /\b-?(0b((0|1))*(y|uy)?)\b/g
+			pattern: /\b-?(0b[01]*(y|uy)?)\b/g
 		},
 		{
-			pattern: /\b-?(\d*\.(f|\d)?\d*(f|F|m|M|((E|e)(\+|-)?\d*))?)\b/g
+			pattern: /\b-?(\d*\.(\d*)?([fFmM]|[Ee](\+|-)?\d*)?)\b/g
 		},
 		{
-			pattern: /\b-?(\d{1,}(y|uy|s|us|l|u|ul|L|UL|I)?)\b/g
+			pattern: /\b-?(\d+.([uy]|[us]|[ul]|[UL]|I)?)\b/g
 		}
 	]
 });
\ No newline at end of file
diff --git a/components/prism-fsharp.min.js b/components/prism-fsharp.min.js
index 09aa2fb..b70ceb6 100644
--- a/components/prism-fsharp.min.js
+++ b/components/prism-fsharp.min.js
@@ -1 +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)?.)*?\1(B)?/g,preprocessor:/^\s*#.*/gm,number:[{pattern:/\b-?(0x((\d*)|([a-fA-F]*))*(un|LF)?)\b/g},{pattern:/\b-?(0b((0|1))*(y|uy)?)\b/g},{pattern:/\b-?(\d*\.(f|\d)?\d*(f|F|m|M|((E|e)(\+|-)?\d*))?)\b/g},{pattern:/\b-?(\d{1,}(y|uy|s|us|l|u|ul|L|UL|I)?)\b/g}]});
\ No newline at end of file
+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:[{pattern:/\b-?(0x[\da-fA-F]*.(un|LF)?)\b/g},{pattern:/\b-?(0b[01]*(y|uy)?)\b/g},{pattern:/\b-?(\d*\.(\d*)?([fFmM]|[Ee](\+|-)?\d*)?)\b/g},{pattern:/\b-?(\d+.([uy]|[us]|[ul]|[UL]|I)?)\b/g}]});
\ No newline at end of file
diff --git a/examples.js b/examples.js
index 43bffd7..74c5aaf 100644
--- a/examples.js
+++ b/examples.js
@@ -6,7 +6,7 @@
 
 var examples = {};
 
-var treeURL = 'https://api.github.com/repos/simonreynolds7/prism/git/trees/fsharp-support?recursive=1';
+var treeURL = 'https://api.github.com/repos/LeaVerou/prism/git/trees/gh-pages?recursive=1';
 var treePromise = new Promise(function (resolve) {
 	$u.xhr({
 		url: treeURL,
diff --git a/examples/prism-fsharp.html b/examples/prism-fsharp.html
index 4815b2c..9276a4c 100644
--- a/examples/prism-fsharp.html
+++ b/examples/prism-fsharp.html
@@ -40,10 +40,13 @@ comment *)</code></pre>
 //Float
 4.14F
 4.14f
+4.f
+4.F
 //Double
 4.14
 2.3E+32
 2.3e+32
+2.3e-32
 2.3e32
 0x0000000000000000LF
 //BigInt
@@ -51,6 +54,8 @@ comment *)</code></pre>
 //Decimal
 0.7833M
 0.7833m
+3.m
+3.M
 </code></pre>
 
 <h2>Full example</h2>