Commit df8267d6ee80c2f5a08fba94daaaae888ac631c7

Golmote 2015-03-09T22:41:12

Merge branch 'gh-pages' of https://github.com/PrismJS/prism into prism-textile Conflicts: components.js

diff --git a/components.js b/components.js
index 8bcbff2..98cc22b 100644
--- a/components.js
+++ b/components.js
@@ -303,6 +303,10 @@ var components = {
 			"require": "clike",
 			"owner": "simonreynolds7"
 		},
+		"sas": {
+			"title": "SAS",
+			"owner": "Golmote"
+		},
 		"textile": {
 			"title": "Textile",
 			"require": "markup",
diff --git a/components/prism-sas.js b/components/prism-sas.js
new file mode 100644
index 0000000..e8696d2
--- /dev/null
+++ b/components/prism-sas.js
@@ -0,0 +1,35 @@
+Prism.languages.sas = {
+	'datalines': {
+		pattern: /(^|[\r\n])\s*(?:(?:data)?lines|cards);[\s\S]+?[\r\n];/i,
+		lookbehind: true,
+		inside: {
+			'keyword': {
+				pattern: /^(\s*)(?:(?:data)?lines|cards)/i,
+				lookbehind: true
+			},
+			'punctuation': /;/,
+			'data': {
+				pattern: /[\s\S]+/,
+				alias: 'string'
+			}
+		}
+	},
+	'comment': [
+		{
+			pattern: /(^\s*|;\s*)\*.*;/m,
+			lookbehind: true
+		},
+		/\/\*[\s\S]+?\*\//
+	],
+	'datetime': {
+		// '1jan2013'd, '9:25:19pm't, '18jan2003:9:27:05am'dt
+		pattern: /'[^']+'(?:d|d?t)\b/i,
+		alias: 'number'
+	},
+	'string': /(["'])(?:\1\1|(?!\1)[\s\S])*\1/,
+	'keyword': /\b(?:data|else|format|if|input|proc|run|then)\b/i,
+	// Decimal (1.2e23), hexadecimal (0c1x)
+	'number': /(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,
+	'operator': /\*\*|\|\||!!|¦¦|<>|><|[~¬^<>]?=|[*\/+\-<>&\|!¦~¬^]|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,
+	'punctuation': /[$%@.(){}\[\];,\\]/
+};
\ No newline at end of file
diff --git a/components/prism-sas.min.js b/components/prism-sas.min.js
new file mode 100644
index 0000000..edb975c
--- /dev/null
+++ b/components/prism-sas.min.js
@@ -0,0 +1 @@
+Prism.languages.sas={datalines:{pattern:/(^|[\r\n])\s*(?:(?:data)?lines|cards);[\s\S]+?[\r\n];/i,lookbehind:!0,inside:{keyword:{pattern:/^(\s*)(?:(?:data)?lines|cards)/i,lookbehind:!0},punctuation:/;/,data:{pattern:/[\s\S]+/,alias:"string"}}},comment:[{pattern:/(^\s*|;\s*)\*.*;/m,lookbehind:!0},/\/\*[\s\S]+?\*\//],datetime:{pattern:/'[^']+'(?:d|d?t)\b/i,alias:"number"},string:/(["'])(?:\1\1|(?!\1)[\s\S])*\1/,keyword:/\b(?:data|else|format|if|input|proc|run|then)\b/i,number:/(?:\B-|\b)(?:[\da-f]+x|\d+(?:\.\d+)?(?:e[+-]?\d+)?)/i,operator:/\*\*|\|\||!!|¦¦|<>|><|[~¬^<>]?=|[*\/+\-<>&\|!¦~¬^]|\b(?:eq|ne|gt|lt|ge|le|in|not)\b/i,punctuation:/[$%@.(){}\[\];,\\]/};
\ No newline at end of file
diff --git a/examples/prism-sas.html b/examples/prism-sas.html
new file mode 100644
index 0000000..9d9acef
--- /dev/null
+++ b/examples/prism-sas.html
@@ -0,0 +1,161 @@
+<h1>SAS</h1>
+<p>To use this language, use the class "language-sas".</p>
+
+<h2>Comments</h2>
+<pre><code>/* This is a
+multi-line comment */
+
+* This is a comment too;</code></pre>
+
+<h2>Numbers, dates and times</h2>
+<pre><code>42; 4.5; 4.5e-10; -3; -3.5e2; -4.2e-23;
+0afx; 0123x; abcdefx;
+'1jan2013'd; '01jan09'd;
+'9:25't; '9:25:19pm't;
+'01may12:9:30:00'dt; '18jan2003:9:27:05am'dt;
+'2013-05-17T09:15:30–05:00'dt; '2013-05-17T09:15:30–05'dt;
+'2013-07-20T12:00:00+00:00'dt; '2013-07-20T12:00:00Z'dt;</code></pre>
+
+<h2>Strings</h2>
+<pre><code>'Single quoted string';
+"Double quoted string";
+'String ''quoted'' string "containing" quote';
+"Double ""quoted"" string 'containing' quote";</code></pre>
+
+<h2>Operators</h2>
+<pre><code>A**B;
+'foo'||'bar'!!'baz'¦¦'test';
+A&lt;>B>&lt;C;
+A~=B¬=C^=D>=E<=F;
+a*b/c+d-e&lt;f>g&amp;h|i!j¦k;
+~a;¬b;^c;
+(a eq b) ne (c gt d) lt e ge f le h;
+state in ('NY','NJ','PA');
+not a;</code></pre>
+
+<h2>More examples</h2>
+<pre><code>/* Some examples adapted from the documentation (http://support.sas.com/documentation/cdl/en/basess/64003/PDF/default/basess.pdf) */
+
+data city; * another inline comment;
+
+	input Year 4. @7 ServicesPolice comma6.
+		@15 ServicesFire comma6. @22 ServicesWater_Sewer comma6.
+		@30 AdminLabor comma6. @39 AdminSupplies comma6.
+		@45 AdminUtilities comma6.;
+	ServicesTotal=ServicesPolice+ServicesFire+ServicesWater_Sewer;
+	AdminTotal=AdminLabor+AdminSupplies+AdminUtilities;
+	Total=ServicesTotal+AdminTotal;
+
+	Test='A string '' whith a quote';
+	Test2 = "A string "" whith a quote";
+
+	label   Total='Total Outlays'
+			ServicesTotal='Services: Total'
+			ServicesPolice='Services: Police'
+			ServicesFire='Services: Fire'
+			ServicesWater_Sewer='Services: Water &amp; Sewer'
+			AdminTotal='Administration: Total'
+			AdminLabor='Administration: Labor'
+			AdminSupplies='Administration: Supplies'
+			AdminUtilities='Administration: Utilities';
+	datalines;
+1993 2,819 1,120 422 391 63 98
+1994 2,477 1,160 500 172 47 70
+1995 2,028 1,061 510 269 29 79
+1996 2,754 893 540 227 21 67
+1997 2,195 963 541 214 21 59
+1998 1,877 926 535 198 16 80
+1999 1,727 1,111 535 213 27 70
+2000 1,532 1,220 519 195 11 69
+2001 1,448 1,156 577 225 12 58
+2002 1,500 1,076 606 235 19 62
+2003 1,934 969 646 266 11 63
+2004 2,195 1,002 643 256 24 55
+2005 2,204 964 692 256 28 70
+2006 2,175 1,144 735 241 19 83
+2007 2,556 1,341 813 238 25 97
+2008 2,026 1,380 868 226 24 97
+2009 2,526 1,454 946 317 13 89
+2010 2,027 1,486 1,043 226 . 82
+2011 2,037 1,667 1,152 244 20 88
+2012 2,852 1,834 1,318 270 23 74
+2013 2,787 1,701 1,317 307 26 66
+;
+proc datasets library=work nolist
+;
+contents data=city
+;
+run;
+
+
+data city3;
+	set city(firstobs=10 obs=15);
+run;
+
+data services (keep=ServicesTotal ServicesPolice ServicesFire
+				ServicesWater_Sewer)
+	admin (keep=AdminTotal AdminLabor AdminSupplies
+			AdminUtilities);
+	set city(drop=Total);
+run;
+proc print data=services;
+	title 'City Expenditures: Services';
+run;
+
+data newlength;
+	set mylib.internationaltours;
+	length Remarks $ 30;
+	if Vendor = 'Hispania' then Remarks = 'Bonus for 10+ people';
+	else if Vendor = 'Mundial' then Remarks = 'Bonus points';
+	else if Vendor = 'Major' then Remarks = 'Discount for 30+ people';
+run;
+proc print data=newlength;
+	var Country Vendor Remarks;
+	title 'Information About Vendors';
+run;
+
+libname mylib 'permanent-data-library';
+data mylib.departures;
+	input Country $ 1-9 CitiesInTour 11-12 USGate $ 14-26
+	ArrivalDepartureGates $ 28-48;
+	datalines;
+Japan 5 San Francisco Tokyo, Osaka
+Italy 8 New York Rome, Naples
+Australia 12 Honolulu Sydney, Brisbane
+Venezuela 4 Miami Caracas, Maracaibo
+Brazil 4 Rio de Janeiro, Belem
+;
+proc print data=mylib.departures;
+	title 'Data Set AIR.DEPARTURES';
+run;
+
+data missingval;
+	length Country $ 10 TourGuide $ 10;
+	input Country TourGuide;
+	* lines is an alias for datalines;
+	lines;
+Japan Yamada
+Italy Militello
+Australia Edney
+Venezuela .
+Brazil Cardoso
+;
+
+data inventory_tool;
+	input PartNumber $ Description $ InStock @17
+		ReceivedDate date9. @27 Price;
+	format ReceivedDate date9.;
+	* cards is an alias for datalines;
+	cards;
+K89R seal 34 27jul2010 245.00
+M4J7 sander 98 20jun2011 45.88
+LK43 filter 121 19may2011 10.99
+MN21 brace 43 10aug2012 27.87
+BC85 clamp 80 16aug2012 9.55
+NCF3 valve 198 20mar2012 24.50
+KJ66 cutter 6 18jun2010 19.77
+UYN7 rod 211 09sep2010 11.55
+JD03 switch 383 09jan2013 13.99
+BV1E timer 26 03aug2013 34.50
+;
+run;</code></pre>
\ No newline at end of file
diff --git a/themes/prism-coy.css b/themes/prism-coy.css
index 831d03f..8db555e 100644
--- a/themes/prism-coy.css
+++ b/themes/prism-coy.css
@@ -215,3 +215,17 @@ pre[class*="language-"].line-numbers code {
 pre[class*="language-"].line-numbers .line-numbers-rows {
 	left: 0;
 }
+
+/* Plugin styles: Line Highlight */
+pre[class*="language-"][data-line] {
+	padding-top: 0;
+	padding-bottom: 0;
+	padding-left: 0;
+}
+pre[data-line] code {
+	position: relative;
+	padding-left: 4em;
+}
+pre .line-highlight {
+	margin-top: 0;
+}
\ No newline at end of file