update inbox list

This commit is contained in:
manhlab
2021-04-07 19:25:18 -04:00
parent fda7245f7c
commit 436de2efd6
8576 changed files with 1013325 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
<span class="hljs-comment">; line comment</span>
<span class="hljs-attribute">ruleset</span> = [optional] *(group1 / group2 / <span class="hljs-keyword">SP</span>) <span class="hljs-keyword">CRLF</span> <span class="hljs-comment">; trailing comment</span>
<span class="hljs-attribute">group1</span> = alt1
<span class="hljs-attribute">group1</span> =/ alt2
<span class="hljs-attribute">alt1</span> = <span class="hljs-symbol">%x41-4D</span> / <span class="hljs-symbol">%d78-90</span>
<span class="hljs-attribute">alt2</span> = <span class="hljs-symbol">%b00100001</span>
<span class="hljs-attribute">group2</span> = *<span class="hljs-number">1</span><span class="hljs-keyword">DIGIT</span> / <span class="hljs-number">2</span>*<span class="hljs-keyword">HEXDIG</span> / <span class="hljs-number">3</span>*<span class="hljs-number">4</span><span class="hljs-keyword">OCTET</span>
a
<span class="hljs-attribute">optional</span> = hex-codes
/ literal
/ sensitive
/ insensitive
<span class="hljs-attribute">hex-codes</span> = <span class="hljs-symbol">%x68.65.6C.6C.6F</span>
<span class="hljs-attribute">literal</span> = <span class="hljs-string">"string literal"</span>
<span class="hljs-attribute">sensitive</span> = <span class="hljs-symbol">%s</span><span class="hljs-string">"case-sensitive string"</span>
<span class="hljs-attribute">insensitive</span> = <span class="hljs-symbol">%i</span><span class="hljs-string">"case-insensitive string"</span>

View File

@@ -0,0 +1,22 @@
; line comment
ruleset = [optional] *(group1 / group2 / SP) CRLF ; trailing comment
group1 = alt1
group1 =/ alt2
alt1 = %x41-4D / %d78-90
alt2 = %b00100001
group2 = *1DIGIT / 2*HEXDIG / 3*4OCTET
a
optional = hex-codes
/ literal
/ sensitive
/ insensitive
hex-codes = %x68.65.6C.6C.6F
literal = "string literal"
sensitive = %s"case-sensitive string"
insensitive = %i"case-insensitive string"

View File

@@ -0,0 +1,5 @@
<span class="hljs-number">20.164.151.111</span> - - <span class="hljs-string">[20/Aug/2015:22:20:18 -0400]</span> <span class="hljs-string">"<span class="hljs-keyword">GET</span> /mywebpage/index.php HTTP/1.1"</span> <span class="hljs-number">403</span> <span class="hljs-number">772</span> <span class="hljs-string">"-"</span> <span class="hljs-string">"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1"</span>
<span class="hljs-number">127.0.0.1</span> user-identifier frank <span class="hljs-string">[10/Oct/2000:13:55:36 -0700]</span> <span class="hljs-string">"<span class="hljs-keyword">GET</span> /apache_pb.gif HTTP/1.0"</span> <span class="hljs-number">200</span> <span class="hljs-number">2326</span>
<span class="hljs-number">192.168.2.20</span> - - <span class="hljs-string">[28/Jul/2006:10:27:10 -0300]</span> <span class="hljs-string">"<span class="hljs-keyword">GET</span> /cgi-bin/try/ HTTP/1.0"</span> <span class="hljs-number">200</span> <span class="hljs-number">3395</span>
<span class="hljs-number">127.0.0.90</span> - - <span class="hljs-string">[13/Sep/2006:07:00:53 -0700]</span> <span class="hljs-string">"PROPFIND /svn/some_url/Extranet/branches/SOW-101 HTTP/1.1"</span> <span class="hljs-number">401</span> <span class="hljs-number">587</span>
<span class="hljs-number">66.249.78.17</span> <span class="hljs-string">[13/Jul/2015:07:18:58 -0400]</span> <span class="hljs-string">"<span class="hljs-keyword">GET</span> /robots.txt HTTP/1.1"</span> <span class="hljs-number">200</span> <span class="hljs-number">0</span> <span class="hljs-string">"-"</span> <span class="hljs-string">"Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"</span>

View File

@@ -0,0 +1,5 @@
20.164.151.111 - - [20/Aug/2015:22:20:18 -0400] "GET /mywebpage/index.php HTTP/1.1" 403 772 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.220 Safari/535.1"
127.0.0.1 user-identifier frank [10/Oct/2000:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326
192.168.2.20 - - [28/Jul/2006:10:27:10 -0300] "GET /cgi-bin/try/ HTTP/1.0" 200 3395
127.0.0.90 - - [13/Sep/2006:07:00:53 -0700] "PROPFIND /svn/some_url/Extranet/branches/SOW-101 HTTP/1.1" 401 587
66.249.78.17 [13/Jul/2015:07:18:58 -0400] "GET /robots.txt HTTP/1.1" 200 0 "-" "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)"

View File

@@ -0,0 +1 @@
x.get(<span class="hljs-number">0</span>);

View File

@@ -0,0 +1 @@
x.get(0);

View File

@@ -0,0 +1,9 @@
<span class="hljs-comment">/*
Isolated test for the most recent version
*/</span>
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">offsetPopulation</span>(<span class="hljs-params">offset</span>)</span>{
<span class="hljs-keyword">var</span> popDensity = <span class="hljs-built_in">Round</span>( <span class="hljs-symbol">$feature</span>.POPULATION / <span class="hljs-built_in">AreaGeodetic</span>(<span class="hljs-built_in">Geometry</span>(<span class="hljs-symbol">$feature</span>), <span class="hljs-string">"square-kilometers"</span>) );
<span class="hljs-keyword">var</span> geom = <span class="hljs-built_in">Geometry</span>({ <span class="hljs-string">'x'</span>: offset.x, <span class="hljs-string">'y'</span>: offset.y, <span class="hljs-string">'spatialReference'</span>:{<span class="hljs-string">'wkid'</span>:<span class="hljs-number">102100</span>} });
<span class="hljs-keyword">var</span> myLayer = <span class="hljs-built_in">FeatureSet</span>(<span class="hljs-symbol">$map</span>, [<span class="hljs-string">"POPULATION"</span>, <span class="hljs-string">"ELECTION-DATA"</span>]);
<span class="hljs-keyword">return</span> popDensity;
}

View File

@@ -0,0 +1,9 @@
/*
Isolated test for the most recent version
*/
function offsetPopulation(offset){
var popDensity = Round( $feature.POPULATION / AreaGeodetic(Geometry($feature), "square-kilometers") );
var geom = Geometry({ 'x': offset.x, 'y': offset.y, 'spatialReference':{'wkid':102100} });
var myLayer = FeatureSet($map, ["POPULATION", "ELECTION-DATA"]);
return popDensity;
}

View File

@@ -0,0 +1,24 @@
<span class="hljs-comment">/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/</span>
<span class="hljs-comment">// Pin 13 has an LED connected on most Arduino boards.</span>
<span class="hljs-comment">// give it a name:</span>
<span class="hljs-keyword">int</span> led = <span class="hljs-number">13</span>;
<span class="hljs-comment">// the setup routine runs once when you press reset:</span>
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">setup</span><span class="hljs-params">()</span> </span>{
<span class="hljs-comment">// initialize the digital pin as an output.</span>
<span class="hljs-built_in">pinMode</span>(led, <span class="hljs-literal">OUTPUT</span>);
}
<span class="hljs-comment">// the loop routine runs over and over again forever:</span>
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">loop</span><span class="hljs-params">()</span> </span>{
<span class="hljs-built_in">digitalWrite</span>(led, <span class="hljs-literal">HIGH</span>); <span class="hljs-comment">// turn the LED on (HIGH is the voltage level)</span>
<span class="hljs-built_in">delay</span>(<span class="hljs-number">1000</span>); <span class="hljs-comment">// wait for a second</span>
<span class="hljs-built_in">digitalWrite</span>(led, <span class="hljs-literal">LOW</span>); <span class="hljs-comment">// turn the LED off by making the voltage LOW</span>
<span class="hljs-built_in">delay</span>(<span class="hljs-number">1000</span>); <span class="hljs-comment">// wait for a second</span>
}

View File

@@ -0,0 +1,25 @@
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;
// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

View File

@@ -0,0 +1,3 @@
<span class="hljs-function"><span class="hljs-keyword">public</span> MyClass.<span class="hljs-title">new</span><span class="hljs-params">()</span> <span class="hljs-keyword">throws</span> Exception</span>{
<span class="hljs-comment">// intertype constructor body</span>
}

View File

@@ -0,0 +1,3 @@
public MyClass.new() throws Exception{
// intertype constructor body
}

View File

@@ -0,0 +1,6 @@
<span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">void</span> MyClass.<span class="hljs-title">doSomething</span><span class="hljs-params">()</span> <span class="hljs-keyword">throws</span> Exception</span>{
<span class="hljs-comment">// intertype method body</span>
}
<span class="hljs-keyword">public</span> <span class="hljs-function"><span class="hljs-keyword">void</span> A.<span class="hljs-title">doSomething</span><span class="hljs-params">(<span class="hljs-keyword">int</span> param1)</span></span>{
<span class="hljs-comment">// intertype method body</span>
}

View File

@@ -0,0 +1,6 @@
public void MyClass.doSomething() throws Exception{
// intertype method body
}
public void A.doSomething(int param1){
// intertype method body
}

View File

@@ -0,0 +1,2 @@
<span class="hljs-comment"># Escaped double-quote is not a string</span>
<span class="hljs-built_in">echo</span> <span class="hljs-string">'"quoted"'</span> | tr -d \" &gt; text.txt

View File

@@ -0,0 +1,2 @@
# Escaped double-quote is not a string
echo '"quoted"' | tr -d \" > text.txt

View File

@@ -0,0 +1,3 @@
<span class="hljs-comment"># numbers aren't highlighted in bash as their semantics is</span>
<span class="hljs-comment"># not strictly defined for command line parameters</span>
$ tail -10 access.log

View File

@@ -0,0 +1,3 @@
# numbers aren't highlighted in bash as their semantics is
# not strictly defined for command line parameters
$ tail -10 access.log

View File

@@ -0,0 +1,5 @@
<span class="hljs-comment">/*
<span class="hljs-comment">/*
Ceylon has nested comments.
*/</span>
*/</span>

View File

@@ -0,0 +1,5 @@
/*
/*
Ceylon has nested comments.
*/
*/

View File

@@ -0,0 +1,2 @@
<span class="hljs-meta">user=&gt;</span><span class="clojure"> </span>
<span class="hljs-meta">=&gt;</span><span class="clojure"> </span>

View File

@@ -0,0 +1,2 @@
user=>
=>

View File

@@ -0,0 +1,34 @@
(<span class="hljs-name"><span class="hljs-builtin-name">import</span></span> [java.lang.annotation Retention RetentionPolicy Target ElementType]
[javax.xml.ws WebServiceRef WebServiceRefs])
(<span class="hljs-name">definterface</span> Foo (<span class="hljs-name">foo</span> []))
<span class="hljs-comment">;; annotation on type</span>
(<span class="hljs-name"><span class="hljs-builtin-name">deftype</span></span> <span class="hljs-comment">^{Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions [<span class="hljs-string">"foo"</span> <span class="hljs-string">"bar"</span> <span class="hljs-string">"baz"</span>]
javax.xml.ws.soap.Addressing {<span class="hljs-symbol">:enabled</span> <span class="hljs-literal">false</span> <span class="hljs-symbol">:required</span> <span class="hljs-literal">true</span>}
WebServiceRefs [(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"fred"</span> <span class="hljs-symbol">:type</span> String})
(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"ethel"</span> <span class="hljs-symbol">:mappedName</span> <span class="hljs-string">"lucy"</span>})]}</span>
Bar [<span class="hljs-comment">^int</span> a
<span class="hljs-comment">;; on field</span>
<span class="hljs-comment">^{:tag int
Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions [<span class="hljs-string">"foo"</span> <span class="hljs-string">"bar"</span> <span class="hljs-string">"baz"</span>]
javax.xml.ws.soap.Addressing {<span class="hljs-symbol">:enabled</span> <span class="hljs-literal">false</span> <span class="hljs-symbol">:required</span> <span class="hljs-literal">true</span>}
WebServiceRefs [(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"fred"</span> <span class="hljs-symbol">:type</span> String})
(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"ethel"</span> <span class="hljs-symbol">:mappedName</span> <span class="hljs-string">"lucy"</span>})]}</span>
b]
<span class="hljs-comment">;; on method</span>
Foo (<span class="hljs-comment">^{Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions [<span class="hljs-string">"foo"</span> <span class="hljs-string">"bar"</span> <span class="hljs-string">"baz"</span>]
javax.xml.ws.soap.Addressing {<span class="hljs-symbol">:enabled</span> <span class="hljs-literal">false</span> <span class="hljs-symbol">:required</span> <span class="hljs-literal">true</span>}
WebServiceRefs [(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"fred"</span> <span class="hljs-symbol">:type</span> String})
(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"ethel"</span> <span class="hljs-symbol">:mappedName</span> <span class="hljs-string">"lucy"</span>})]}</span>
foo [this] <span class="hljs-number">42</span>))
(<span class="hljs-name"><span class="hljs-builtin-name">seq</span></span> (<span class="hljs-name">.getAnnotations</span> Bar))
(<span class="hljs-name"><span class="hljs-builtin-name">seq</span></span> (<span class="hljs-name">.getAnnotations</span> (<span class="hljs-name">.getField</span> Bar <span class="hljs-string">"b"</span>)))
(<span class="hljs-name"><span class="hljs-builtin-name">seq</span></span> (<span class="hljs-name">.getAnnotations</span> (<span class="hljs-name">.getMethod</span> Bar <span class="hljs-string">"foo"</span> <span class="hljs-literal">nil</span>)))

View File

@@ -0,0 +1,34 @@
(import [java.lang.annotation Retention RetentionPolicy Target ElementType]
[javax.xml.ws WebServiceRef WebServiceRefs])
(definterface Foo (foo []))
;; annotation on type
(deftype ^{Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"]
javax.xml.ws.soap.Addressing {:enabled false :required true}
WebServiceRefs [(WebServiceRef {:name "fred" :type String})
(WebServiceRef {:name "ethel" :mappedName "lucy"})]}
Bar [^int a
;; on field
^{:tag int
Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"]
javax.xml.ws.soap.Addressing {:enabled false :required true}
WebServiceRefs [(WebServiceRef {:name "fred" :type String})
(WebServiceRef {:name "ethel" :mappedName "lucy"})]}
b]
;; on method
Foo (^{Deprecated true
Retention RetentionPolicy/RUNTIME
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"]
javax.xml.ws.soap.Addressing {:enabled false :required true}
WebServiceRefs [(WebServiceRef {:name "fred" :type String})
(WebServiceRef {:name "ethel" :mappedName "lucy"})]}
foo [this] 42))
(seq (.getAnnotations Bar))
(seq (.getAnnotations (.getField Bar "b")))
(seq (.getAnnotations (.getMethod Bar "foo" nil)))

View File

@@ -0,0 +1 @@
(<span class="hljs-name"><span class="hljs-builtin-name">def</span></span> +x [(<span class="hljs-name">a</span> <span class="hljs-number">1</span>) <span class="hljs-number">+2</span> <span class="hljs-number">-3.0</span> y-5])

View File

@@ -0,0 +1 @@
(def +x [(a 1) +2 -3.0 y-5])

View File

@@ -0,0 +1,8 @@
<span class="hljs-comment"># Divisions</span>
x = <span class="hljs-number">6</span>/foo/i
x = <span class="hljs-number">6</span> /foo
x = <span class="hljs-number">6</span> / foo
x = <span class="hljs-number">6</span> /foo * <span class="hljs-number">2</span>/gm
x = f /foo
x = f / foo / gm
x = f /foo * <span class="hljs-number">2</span>/<span class="hljs-number">6</span>

View File

@@ -0,0 +1,8 @@
# Divisions
x = 6/foo/i
x = 6 /foo
x = 6 / foo
x = 6 /foo * 2/gm
x = f /foo
x = f / foo / gm
x = f /foo * 2/6

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
<span class="hljs-function"><span class="hljs-title">returnNull</span> = -&gt;</span> <span class="hljs-literal">null</span>
<span class="hljs-function"><span class="hljs-title">returnTrue</span> = <span class="hljs-params">()</span> -&gt;</span> <span class="hljs-literal">true</span>
<span class="hljs-function"><span class="hljs-title">square</span> = <span class="hljs-params">(x)</span> -&gt;</span> x * x
npmWishlist.sha256 = <span class="hljs-function"><span class="hljs-params">(str)</span> -&gt;</span>
<span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> Error()
str.split(<span class="hljs-string">" "</span>).map(<span class="hljs-function"><span class="hljs-params">(m)</span> -&gt;</span> m.charCodeAt(<span class="hljs-number">0</span>))
fs.readFile(<span class="hljs-string">"package.json"</span>, <span class="hljs-string">"utf-8"</span>, <span class="hljs-function"><span class="hljs-params">(err, content)</span> -&gt;</span>
data = JSON.parse(content)
data.version
)

View File

@@ -0,0 +1,14 @@
returnNull = -> null
returnTrue = () -> true
square = (x) -> x * x
npmWishlist.sha256 = (str) ->
throw new Error()
str.split(" ").map((m) -> m.charCodeAt(0))
fs.readFile("package.json", "utf-8", (err, content) ->
data = JSON.parse(content)
data.version
)

View File

@@ -0,0 +1,18 @@
<span class="hljs-comment"># Regexps</span>
x = <span class="hljs-regexp">//</span>
x = (<span class="hljs-regexp">//</span>)
x = (<span class="hljs-regexp">/test/</span>)
x = <span class="hljs-regexp">//mig</span>
x = <span class="hljs-regexp">//gim</span>
x = <span class="hljs-regexp">/something/gim</span>
x = <span class="hljs-regexp">/\//</span>
x = <span class="hljs-regexp">/\n/</span>
x = <span class="hljs-regexp">/ab\/ ab/</span>
x = f <span class="hljs-regexp">/6 * 2/</span> - <span class="hljs-number">3</span>
x = f <span class="hljs-regexp">/foo * 2/gm</span>
x = <span class="hljs-keyword">if</span> <span class="hljs-literal">true</span> <span class="hljs-keyword">then</span> <span class="hljs-regexp">/\n/</span> <span class="hljs-keyword">else</span> <span class="hljs-regexp">/[.,]+/</span>
x = <span class="hljs-regexp">///^key-<span class="hljs-subst">#{key}</span>-\d+///</span>
<span class="hljs-comment"># not a Regexp</span>
x = //test
x = /boo/test

View File

@@ -0,0 +1,18 @@
# Regexps
x = //
x = (//)
x = (/test/)
x = //mig
x = //gim
x = /something/gim
x = /\//
x = /\n/
x = /ab\/ ab/
x = f /6 * 2/ - 3
x = f /foo * 2/gm
x = if true then /\n/ else /[.,]+/
x = ///^key-#{key}-\d+///
# not a Regexp
x = //test
x = /boo/test

View File

@@ -0,0 +1,7 @@
<span class="hljs-keyword">SET</span> test = <span class="hljs-number">1</span>
<span class="hljs-keyword">set</span> <span class="hljs-symbol">^global</span> = <span class="hljs-number">2</span>
<span class="hljs-keyword">Write</span> <span class="hljs-string">"Current date """</span>, <span class="hljs-built_in">$ztimestamp</span>, <span class="hljs-string">""", result: "</span>, test + <span class="hljs-symbol">^global</span> = <span class="hljs-number">3</span>
<span class="hljs-keyword">if</span> (<span class="hljs-symbol">^global</span> = <span class="hljs-number">2</span>) {
<span class="hljs-keyword">do</span> <span class="hljs-keyword">##class</span>(Cinema.Utils).AddShow(<span class="hljs-string">"test"</span>) <span class="hljs-comment">// line comment</span>
}
<span class="hljs-keyword">d</span>:(<span class="hljs-symbol">^global</span> = <span class="hljs-number">2</span>) <span class="hljs-built_in">..thisClassMethod</span>(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-string">"test"</span>)

View File

@@ -0,0 +1,7 @@
SET test = 1
set ^global = 2
Write "Current date """, $ztimestamp, """, result: ", test + ^global = 3
if (^global = 2) {
do ##class(Cinema.Utils).AddShow("test") // line comment
}
d:(^global = 2) ..thisClassMethod(1, 2, "test")

View File

@@ -0,0 +1,5 @@
<span class="hljs-comment">/*
* Multiline comment
*/</span>
&amp;sql(<span class="sql"><span class="hljs-keyword">SELECT</span> * <span class="hljs-keyword">FROM</span> Cinema.Film <span class="hljs-keyword">WHERE</span> <span class="hljs-keyword">Length</span> &gt; <span class="hljs-number">2</span></span>)
&amp;js&lt;<span class="javascript"><span class="hljs-keyword">for</span> (<span class="hljs-keyword">var</span> i = <span class="hljs-number">0</span>; i &lt; <span class="hljs-built_in">String</span>(<span class="hljs-string">"test"</span>).split(<span class="hljs-string">""</span>).length); ++i) { <span class="hljs-built_in">console</span>.log(i); }</span>&gt;

View File

@@ -0,0 +1,5 @@
/*
* Multiline comment
*/
&sql(SELECT * FROM Cinema.Film WHERE Length > 2)
&js<for (var i = 0; i < String("test").split("").length); ++i) { console.log(i); }>

View File

@@ -0,0 +1,2 @@
<span class="hljs-keyword">double</span> x = <span class="hljs-built_in">exp</span>(<span class="hljs-built_in">log</span>(<span class="hljs-number">2</span>)); <span class="hljs-comment">// recognize built-ins</span>
<span class="hljs-keyword">return</span> <span class="hljs-number">0</span>; <span class="hljs-comment">// recognize keyword that started the expression</span>

View File

@@ -0,0 +1,2 @@
double x = exp(log(2)); // recognize built-ins
return 0; // recognize keyword that started the expression

View File

@@ -0,0 +1,16 @@
<span class="hljs-function"><span class="hljs-keyword">decltype</span>(<span class="hljs-keyword">auto</span>) <span class="hljs-title">look_up_a_string_1</span><span class="hljs-params">()</span> </span>{ <span class="hljs-keyword">return</span> lookup1(); }
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">look_up_a_string_2</span><span class="hljs-params">()</span> </span>{ <span class="hljs-keyword">return</span> lookup2(); }
<span class="hljs-function"><span class="hljs-keyword">friend</span> <span class="hljs-keyword">void</span> <span class="hljs-title">A::showB</span><span class="hljs-params">(B x)</span> </span>{}
<span class="hljs-function"><span class="hljs-keyword">friend</span> <span class="hljs-keyword">void</span> <span class="hljs-title">showB</span><span class="hljs-params">(B x)</span> </span>{}
<span class="hljs-function"><span class="hljs-keyword">friend</span> <span class="hljs-keyword">void</span> <span class="hljs-title">showB</span><span class="hljs-params">(B::SomeType x)</span> </span>{}
<span class="hljs-function"><span class="hljs-keyword">inline</span> <span class="hljs-keyword">int</span> <span class="hljs-title">add</span><span class="hljs-params">(<span class="hljs-keyword">int</span> a, <span class="hljs-keyword">int</span> b)</span> </span>{}
<span class="hljs-function">int8t <span class="hljs-title">Get_Tile_Value</span><span class="hljs-params">()</span> </span>{}
<span class="hljs-function"><span class="hljs-keyword">int8_t</span> <span class="hljs-title">Get_Tile_Value</span><span class="hljs-params">()</span> </span>{}
<span class="hljs-function">B::type <span class="hljs-title">test</span><span class="hljs-params">()</span> </span>{};
<span class="hljs-comment">// template</span>
<span class="hljs-function">boost::optional&lt;application&gt; <span class="hljs-title">handle_key</span><span class="hljs-params">(application state, key_code key, coord size)</span></span>;
test();

View File

@@ -0,0 +1,16 @@
decltype(auto) look_up_a_string_1() { return lookup1(); }
void look_up_a_string_2() { return lookup2(); }
friend void A::showB(B x) {}
friend void showB(B x) {}
friend void showB(B::SomeType x) {}
inline int add(int a, int b) {}
int8t Get_Tile_Value() {}
int8_t Get_Tile_Value() {}
B::type test() {};
// template
boost::optional<application> handle_key(application state, key_code key, coord size);
test();

View File

@@ -0,0 +1,7 @@
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">f</span><span class="hljs-params">(
<span class="hljs-keyword">int</span> a = <span class="hljs-number">1</span>,
<span class="hljs-keyword">char</span>* b = <span class="hljs-string">"2"</span>, <span class="hljs-comment">// Line comment</span>
<span class="hljs-keyword">double</span> c = <span class="hljs-number">3.0</span>, <span class="hljs-comment">/* Block comment */</span>
ARRAY(<span class="hljs-keyword">int</span>, <span class="hljs-number">5</span>) d,
<span class="hljs-keyword">void</span>* e __attribute__((unused))
)</span></span>;

View File

@@ -0,0 +1,7 @@
int f(
int a = 1,
char* b = "2", // Line comment
double c = 3.0, /* Block comment */
ARRAY(int, 5) d,
void* e __attribute__((unused))
);

View File

@@ -0,0 +1,9 @@
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{
A a = <span class="hljs-keyword">new</span> A();
<span class="hljs-keyword">int</span> b = b * sum(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>);
<span class="hljs-keyword">if</span> (a-&gt;check1())
<span class="hljs-keyword">return</span> <span class="hljs-number">3</span>;
<span class="hljs-keyword">else</span> <span class="hljs-keyword">if</span> (a-&gt;check2())
<span class="hljs-keyword">return</span> <span class="hljs-number">4</span>;
<span class="hljs-keyword">return</span> a-&gt;result();
}

View File

@@ -0,0 +1,9 @@
int main() {
A a = new A();
int b = b * sum(1, 2);
if (a->check1())
return 3;
else if (a->check2())
return 4;
return a->result();
}

View File

@@ -0,0 +1,6 @@
<span class="hljs-comment">/* digit separators */</span>
<span class="hljs-keyword">int</span> number = <span class="hljs-number">2'555'555'555</span>; <span class="hljs-comment">// digit separators</span>
<span class="hljs-keyword">float</span> exponentFloat = <span class="hljs-number">.123'456e3'000</span>; <span class="hljs-comment">// digit separators in floats</span>
<span class="hljs-keyword">float</span> suffixed = <span class="hljs-number">3.000'001'234f</span> <span class="hljs-comment">// digit separators in suffixed numbers</span>
<span class="hljs-keyword">char</span> word[] = { <span class="hljs-string">'3'</span>, <span class="hljs-string">'\0'</span> }; <span class="hljs-comment">// make sure digit separators don't mess up chars</span>
<span class="hljs-keyword">float</span> negative = <span class="hljs-number">-123.0f</span>; <span class="hljs-comment">// negative floating point numbers</span>

View File

@@ -0,0 +1,6 @@
/* digit separators */
int number = 2'555'555'555; // digit separators
float exponentFloat = .123'456e3'000; // digit separators in floats
float suffixed = 3.000'001'234f // digit separators in suffixed numbers
char word[] = { '3', '\0' }; // make sure digit separators don't mess up chars
float negative = -123.0f; // negative floating point numbers

View File

@@ -0,0 +1,4 @@
<span class="hljs-comment">// These will all work:</span>
<span class="hljs-function"><span class="hljs-keyword">char</span>** <span class="hljs-title">foo_bar</span><span class="hljs-params">()</span></span>;
<span class="hljs-function"><span class="hljs-keyword">char</span> ** <span class="hljs-title">foo_bar</span><span class="hljs-params">()</span></span>;
<span class="hljs-function"><span class="hljs-keyword">char</span> **<span class="hljs-title">foo_bar</span><span class="hljs-params">()</span></span>;

View File

@@ -0,0 +1,4 @@
// These will all work:
char** foo_bar();
char ** foo_bar();
char **foo_bar();

View File

@@ -0,0 +1,19 @@
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;iostream&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> foo 1&lt;&lt;16</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">ifdef</span> DEBUG</span>
<span class="hljs-function">TYPE1 <span class="hljs-title">foo</span><span class="hljs-params">(<span class="hljs-keyword">void</span>)</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">else</span></span>
<span class="hljs-keyword">int</span> <span class="hljs-title">foo</span><span class="hljs-params">(<span class="hljs-keyword">void</span>)</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span></span>
</span>{ }
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> x(v) ((v))</span>
<span class="hljs-meta"># <span class="hljs-meta-keyword">define</span> x(v) ((v))</span>
<span class="hljs-meta"># <span class="hljs-meta-keyword">define</span> x(v) ((v))</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">if</span> MACRO_WITH_STRING_ARG(<span class="hljs-meta-string">"hello \"world\""</span>)</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">elif</span> MULTI_LINE <span class="hljs-comment">/* comment */</span> &lt; \
EXPRESSION</span>
<span class="hljs-keyword">int</span> bar;
<span class="hljs-meta">#<span class="hljs-meta-keyword">endif</span> <span class="hljs-comment">// comment</span></span>

View File

@@ -0,0 +1,19 @@
#include <iostream>
#define foo 1<<16
#ifdef DEBUG
TYPE1 foo(void)
#else
int foo(void)
#endif
{ }
#define x(v) ((v))
# define x(v) ((v))
# define x(v) ((v))
#if MACRO_WITH_STRING_ARG("hello \"world\"")
#elif MULTI_LINE /* comment */ < \
EXPRESSION
int bar;
#endif // comment

View File

@@ -0,0 +1,3 @@
<span class="hljs-keyword">const</span> <span class="hljs-keyword">uint64_t</span> MAX_INT_64;
<span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">position_tag</span>;</span>

View File

@@ -0,0 +1,3 @@
const uint64_t MAX_INT_64;
struct position_tag;

View File

@@ -0,0 +1,69 @@
<span class="hljs-comment">// Unicode literals</span>
<span class="hljs-keyword">auto</span> str = <span class="hljs-string">"Hello regular string"</span>;
<span class="hljs-keyword">auto</span> utf8 = <span class="hljs-string">u8"Hello utf-8 string"</span>;
<span class="hljs-keyword">auto</span> utf16 = <span class="hljs-string">u"Hello utf-16 string"</span>;
<span class="hljs-keyword">auto</span> utf32 = <span class="hljs-string">U"Hello utf-32 string"</span>;
<span class="hljs-comment">// Wide-character strings</span>
<span class="hljs-keyword">auto</span> wide_char = <span class="hljs-string">L"Hello wchar_t string"</span>;
<span class="hljs-keyword">auto</span> lr = <span class="hljs-string">LR"(Hello
world)"</span>;
<span class="hljs-comment">// character literals</span>
<span class="hljs-keyword">auto</span> wide_char = <span class="hljs-string">L'H'</span>;
<span class="hljs-keyword">auto</span> cr = <span class="hljs-string">'\n'</span>;
<span class="hljs-keyword">auto</span> chr = <span class="hljs-string">'H'</span>;
<span class="hljs-keyword">auto</span> utf8 = <span class="hljs-string">u8'H'</span>;
<span class="hljs-keyword">auto</span> utf16 = <span class="hljs-string">u'H'</span>;
<span class="hljs-keyword">auto</span> utf32 = <span class="hljs-string">U'H'</span>;
<span class="hljs-keyword">auto</span> unicode = <span class="hljs-string">L'\u202e'</span>
<span class="hljs-keyword">auto</span> hex = <span class="hljs-string">'\xFF'</span>
<span class="hljs-keyword">auto</span> octal = <span class="hljs-string">'\123'</span>
<span class="hljs-comment">// Raw string literals (multiline)</span>
<span class="hljs-keyword">auto</span> char_multi = <span class="hljs-string">R"(Hello
"normal"
multiline
string.)"</span>;
<span class="hljs-keyword">auto</span> utf8_multi = <span class="hljs-string">u8R"(Hello
"utf-8"
multiline
string)"</span>;
<span class="hljs-keyword">auto</span> utf16_multi = <span class="hljs-string">uR"(Hello
"utf-16"
multiline
string)"</span>;
<span class="hljs-keyword">auto</span> utf32_multi = <span class="hljs-string">UR"(Hello
"utf-32"
multiline
string)"</span>;
<span class="hljs-comment">// Raw string literals with delimiter (multiline)</span>
<span class="hljs-keyword">auto</span> char_multi = <span class="hljs-string">R"blah1(Hello
"normal"
multiline
)"
)blah"
string.)blah1"</span>;
<span class="hljs-keyword">auto</span> utf8_multi = <span class="hljs-string">u8R"blah2(Hello
"utf-8"
multiline
)"
)blah"
string)blah2"</span>;
<span class="hljs-keyword">auto</span> utf16_multi = <span class="hljs-string">uR"blah3(Hello
"utf-16"
multiline
)"
)blah"
string)blah3"</span>;
<span class="hljs-keyword">auto</span> utf32_multi = <span class="hljs-string">UR"blah4(Hello
"utf-32"
multiline
)"
)blah"
string)blah4"</span>;
<span class="hljs-comment">// Meta strings</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;stdio&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">"lib.h"</span></span>

View File

@@ -0,0 +1,69 @@
// Unicode literals
auto str = "Hello regular string";
auto utf8 = u8"Hello utf-8 string";
auto utf16 = u"Hello utf-16 string";
auto utf32 = U"Hello utf-32 string";
// Wide-character strings
auto wide_char = L"Hello wchar_t string";
auto lr = LR"(Hello
world)";
// character literals
auto wide_char = L'H';
auto cr = '\n';
auto chr = 'H';
auto utf8 = u8'H';
auto utf16 = u'H';
auto utf32 = U'H';
auto unicode = L'\u202e'
auto hex = '\xFF'
auto octal = '\123'
// Raw string literals (multiline)
auto char_multi = R"(Hello
"normal"
multiline
string.)";
auto utf8_multi = u8R"(Hello
"utf-8"
multiline
string)";
auto utf16_multi = uR"(Hello
"utf-16"
multiline
string)";
auto utf32_multi = UR"(Hello
"utf-32"
multiline
string)";
// Raw string literals with delimiter (multiline)
auto char_multi = R"blah1(Hello
"normal"
multiline
)"
)blah"
string.)blah1";
auto utf8_multi = u8R"blah2(Hello
"utf-8"
multiline
)"
)blah"
string)blah2";
auto utf16_multi = uR"blah3(Hello
"utf-16"
multiline
)"
)blah"
string)blah3";
auto utf32_multi = UR"blah4(Hello
"utf-32"
multiline
)"
)blah"
string)blah4";
// Meta strings
#include <stdio>
#include "lib.h"

View File

@@ -0,0 +1,14 @@
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">foo</span></span>
<span class="hljs-keyword">end</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">*</span></span>(other)
<span class="hljs-keyword">end</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">**</span></span>(other)
<span class="hljs-keyword">end</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">=~</span></span>(other)
<span class="hljs-keyword">end</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">!~</span></span>(other)
<span class="hljs-keyword">end</span>

View File

@@ -0,0 +1,14 @@
def foo
end
def *(other)
end
def **(other)
end
def =~(other)
end
def !~(other)
end

View File

@@ -0,0 +1,98 @@
<span class="hljs-literal">nil</span>
<span class="hljs-literal">true</span>
<span class="hljs-literal">false</span>
<span class="hljs-number">1</span>
<span class="hljs-number">1_i8</span>
<span class="hljs-number">1_i16</span>
<span class="hljs-number">1_i32</span>
<span class="hljs-number">1_i64</span>
<span class="hljs-number">1_i128</span>
<span class="hljs-number">1_u8</span>
<span class="hljs-number">1_u16</span>
<span class="hljs-number">1_u32</span>
<span class="hljs-number">1_u64</span>
+<span class="hljs-number">10</span>
-<span class="hljs-number">20</span>
<span class="hljs-number">2147483648</span>
<span class="hljs-number">9223372036854775808</span>
<span class="hljs-number">1_000_000</span>
<span class="hljs-number">0b1101</span>
<span class="hljs-number">0o123</span>
<span class="hljs-number">0xFE012D</span>
<span class="hljs-number">0xfe012d</span>
<span class="hljs-number">1_f64</span>
<span class="hljs-number">1.0</span>
<span class="hljs-number">1.0_f32</span>
<span class="hljs-number">1_f32</span>
<span class="hljs-number">1e10</span>
<span class="hljs-number">1e10_f64</span>
<span class="hljs-number">1.5e10</span>
<span class="hljs-number">1.5e-7</span>
+<span class="hljs-number">1.3</span>
-<span class="hljs-number">0.5</span>
<span class="hljs-number">1_000_000.111_111</span>
<span class="hljs-number">1_000_000.111_111e12</span>
<span class="hljs-string">'c'</span>
<span class="hljs-string">'\\'</span>
<span class="hljs-string">'\u{ABCD}'</span>
<span class="hljs-string">"string"</span>
<span class="hljs-string">"\u{48 45 4C 4C 4F}"</span>
<span class="hljs-string">"interpolated <span class="hljs-subst">#{string}</span>"</span>
<span class="hljs-string">"interpolated <span class="hljs-subst">#{<span class="hljs-string">"string"</span>}</span>"</span>
<span class="hljs-string">%(string)</span>
<span class="hljs-string">%q(string)</span>
<span class="hljs-string">%Q(string)</span>
<span class="hljs-string">%(hello ("world"))</span>
<span class="hljs-string">%[hello ["world"]]</span>
<span class="hljs-string">%{hello {"world"}}</span>
<span class="hljs-string">%&lt;hello &lt;"world"&gt;&gt;</span>
<span class="hljs-string">%|hello "world"|</span>
<span class="hljs-string">"hello
world"</span>
<span class="hljs-string">"hello \
world, \
no newlines"</span>
<span class="hljs-string">&lt;&lt;-STRING
Hello world
STRING</span>
<span class="hljs-string">&lt;&lt;-'HERE'
hello \n
HERE</span>
:unquoted_symbol
:<span class="hljs-string">"quoted symbol"</span>
:question?
:exclamation!
:+
<span class="hljs-string">%i(foo(bar) baz)</span>
<span class="hljs-string">%w(one two three)</span>
<span class="hljs-regexp">/foo|bar/</span>
<span class="hljs-regexp">/h(e+)llo/</span>
<span class="hljs-regexp">/\d+/</span>
<span class="hljs-regexp">/あ/</span>
<span class="hljs-regexp">%r((/))</span>
<span class="hljs-regexp">%r[[/]]</span>
<span class="hljs-regexp">%r{{/}}</span>
<span class="hljs-regexp">%r&lt;&lt;/&gt;&gt;</span>
<span class="hljs-regexp">%r|/|</span>
<span class="hljs-string">`echo foo &gt; foo.txt`</span>

View File

@@ -0,0 +1,98 @@
nil
true
false
1
1_i8
1_i16
1_i32
1_i64
1_i128
1_u8
1_u16
1_u32
1_u64
+10
-20
2147483648
9223372036854775808
1_000_000
0b1101
0o123
0xFE012D
0xfe012d
1_f64
1.0
1.0_f32
1_f32
1e10
1e10_f64
1.5e10
1.5e-7
+1.3
-0.5
1_000_000.111_111
1_000_000.111_111e12
'c'
'\\'
'\u{ABCD}'
"string"
"\u{48 45 4C 4C 4F}"
"interpolated #{string}"
"interpolated #{"string"}"
%(string)
%q(string)
%Q(string)
%(hello ("world"))
%[hello ["world"]]
%{hello {"world"}}
%<hello <"world">>
%|hello "world"|
"hello
world"
"hello \
world, \
no newlines"
<<-STRING
Hello world
STRING
<<-'HERE'
hello \n
HERE
:unquoted_symbol
:"quoted symbol"
:question?
:exclamation!
:+
%i(foo(bar) baz)
%w(one two three)
/foo|bar/
/h(e+)llo/
/\d+/
/あ/
%r((/))
%r[[/]]
%r{{/}}
%r<</>>
%r|/|
`echo foo > foo.txt`

View File

@@ -0,0 +1,9 @@
puts <span class="hljs-template-variable">{{ <span class="hljs-string">"hello world"</span> }}</span>
<span class="hljs-template-variable">{% <span class="hljs-keyword">verbatim</span> %}</span><span class="hljs-template-variable">{{ <span class="hljs-string">"bla"</span>.id }}</span><span class="hljs-template-variable">{% <span class="hljs-keyword">end</span> %}</span>
<span class="hljs-function"><span class="hljs-keyword">macro</span> <span class="hljs-title">foo</span></span>
<span class="hljs-template-variable">{% <span class="hljs-keyword">verbatim</span> %}</span>
<span class="hljs-template-variable">{{ <span class="hljs-string">"bla"</span>.id }}</span>
<span class="hljs-template-variable">{% <span class="hljs-keyword">end</span> %}</span>
<span class="hljs-keyword">end</span>

View File

@@ -0,0 +1,9 @@
puts {{ "hello world" }}
{% verbatim %}{{ "bla".id }}{% end %}
macro foo
{% verbatim %}
{{ "bla".id }}
{% end %}
end

View File

@@ -0,0 +1,34 @@
+
-
*
%
&amp;
|
^
**
&lt;&lt;
&gt;&gt;
==
!=
&lt;
&lt;=
&gt;
&gt;=
&lt;=&gt;
===
<span class="hljs-regexp">//</span>
<span class="hljs-regexp">//</span>=
&amp;+
&amp;-
&amp;*
&amp;**
&amp;+=
&amp;-=
&amp;*=
!
~
[]
[]?
[]=
<span class="hljs-regexp">/
</span>

View File

@@ -0,0 +1,33 @@
+
-
*
%
&
|
^
**
<<
>>
==
!=
<
<=
>
>=
<=>
===
//
//=
&+
&-
&*
&**
&+=
&-=
&*=
!
~
[]
[]?
[]=
/

View File

@@ -0,0 +1,12 @@
<span class="hljs-keyword">if</span> <span class="hljs-regexp">/foo/</span>
<span class="hljs-keyword">unless</span> <span class="hljs-regexp">/foo/</span>
<span class="hljs-keyword">case</span> <span class="hljs-regexp">/foo/</span>
<span class="hljs-keyword">select</span> <span class="hljs-regexp">/foo/</span>
<span class="hljs-keyword">when</span> <span class="hljs-regexp">/foo/</span>
<span class="hljs-keyword">while</span> <span class="hljs-regexp">/foo/</span>
<span class="hljs-keyword">until</span> <span class="hljs-regexp">/foo/</span>
+<span class="hljs-regexp">/foo/</span>
<span class="hljs-comment"># NG</span>
xif /foo/
ifx /foo/

View File

@@ -0,0 +1,12 @@
if /foo/
unless /foo/
case /foo/
select /foo/
when /foo/
while /foo/
until /foo/
+/foo/
# NG
xif /foo/
ifx /foo/

View File

@@ -0,0 +1,4 @@
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Foo</span>;</span> <span class="hljs-keyword">end</span>
<span class="hljs-class"><span class="hljs-keyword">struct</span> <span class="hljs-title">Bar</span>;</span> <span class="hljs-keyword">end</span>
<span class="hljs-keyword">annotation</span> <span class="hljs-title">JSON::Field</span>; <span class="hljs-keyword">end</span>

View File

@@ -0,0 +1,4 @@
class Foo; end
struct Bar; end
annotation JSON::Field; end

View File

@@ -0,0 +1,6 @@
<span class="hljs-keyword">namespace</span> <span class="hljs-title">Dotted.Namespace</span>
{
<span class="hljs-keyword">class</span> <span class="hljs-title">MyClass</span>
{
}
}

View File

@@ -0,0 +1,6 @@
namespace Dotted.Namespace
{
class MyClass
{
}
}

View File

@@ -0,0 +1,4 @@
<span class="hljs-keyword">float</span> test = <span class="hljs-number">1.0f</span>;
<span class="hljs-keyword">float</span> test2 = <span class="hljs-number">1.f</span>;
<span class="hljs-keyword">float</span> test3 = <span class="hljs-number">1.0</span>;
<span class="hljs-keyword">float</span> test4 = <span class="hljs-number">1</span>;

View File

@@ -0,0 +1,4 @@
float test = 1.0f;
float test2 = 1.f;
float test3 = 1.0;
float test4 = 1;

View File

@@ -0,0 +1,16 @@
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">ExampleFunction1</span>(<span class="hljs-params"></span>)</span> {
}
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">ExampleFunction2</span>(<span class="hljs-params"></span>)</span>
{
}
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">ExampleFunctionDeclaration1</span>(<span class="hljs-params"></span>)</span>;
<span class="hljs-function"><span class="hljs-keyword">void</span> <span class="hljs-title">ExampleFunctionDeclaration2</span>(<span class="hljs-params"></span>)</span>
;
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">string</span> <span class="hljs-title">ExampleExpressionBodiedFunction1</span>(<span class="hljs-params"></span>)</span> =&gt; <span class="hljs-string">"dummy"</span>;
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">string</span> <span class="hljs-title">ExampleExpressionBodiedFunction2</span>(<span class="hljs-params"></span>)</span>
=&gt; <span class="hljs-string">"dummy"</span>;

View File

@@ -0,0 +1,16 @@
public void ExampleFunction1() {
}
public void ExampleFunction2()
{
}
void ExampleFunctionDeclaration1();
void ExampleFunctionDeclaration2()
;
public string ExampleExpressionBodiedFunction1() => "dummy";
public string ExampleExpressionBodiedFunction2()
=> "dummy";

View File

@@ -0,0 +1,9 @@
<span class="hljs-keyword">var</span> istr = <span class="hljs-string">$"{{Hello}},\n<span class="hljs-subst">{<span class="hljs-string">$"\"<span class="hljs-subst">{nested}</span>\""</span> + <span class="hljs-string">@" and "</span> + <span class="hljs-string">$@"""<span class="hljs-subst">{nested}</span>"""</span> <span class="hljs-comment">/*comments*/</span> }</span>"</span>;
<span class="hljs-keyword">var</span> ivstr = <span class="hljs-string">$@"{{Hello}},
<span class="hljs-subst">{
<span class="hljs-string">$"\"<span class="hljs-subst">{nested}</span>\""</span> + <span class="hljs-string">@"
and
"</span> + <span class="hljs-string">$@"
""<span class="hljs-subst">{nested}</span>""
"</span>
<span class="hljs-comment">/*comments*/</span> }</span>"</span>;

View File

@@ -0,0 +1,9 @@
var istr = $"{{Hello}},\n{$"\"{nested}\"" + @" and " + $@"""{nested}""" /*comments*/ }";
var ivstr = $@"{{Hello}},
{
$"\"{nested}\"" + @"
and
" + $@"
""{nested}""
"
/*comments*/ }";

View File

@@ -0,0 +1,19 @@
<span class="hljs-keyword">namespace</span> <span class="hljs-title">Foo</span> <span class="hljs-comment">// namespace</span>
{
<span class="hljs-keyword">public</span> <span class="hljs-keyword">class</span> <span class="hljs-title">Greet</span> : <span class="hljs-title">Base</span>, <span class="hljs-title">Other</span> <span class="hljs-comment">// class</span>
{
<span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-title">Greet</span>(<span class="hljs-params"><span class="hljs-keyword">string</span> who</span>) <span class="hljs-comment">// function</span></span>
{
Who = who;
}
<span class="hljs-function"><span class="hljs-keyword">int</span>[] <span class="hljs-title">f</span>(<span class="hljs-params"><span class="hljs-keyword">int</span> val = <span class="hljs-number">0</span></span>)</span>
{
<span class="hljs-keyword">new</span> Type();
<span class="hljs-keyword">return</span> getType();
<span class="hljs-keyword">throw</span> getError();
<span class="hljs-keyword">await</span> Stuff();
}
}
}

View File

@@ -0,0 +1,19 @@
namespace Foo // namespace
{
public class Greet : Base, Other // class
{
public Greet(string who) // function
{
Who = who;
}
int[] f(int val = 0)
{
new Type();
return getType();
throw getError();
await Stuff();
}
}
}

View File

@@ -0,0 +1,2 @@
<span class="hljs-selector-tag">li</span><span class="hljs-selector-pseudo">:not(.red)</span>{}
<span class="hljs-selector-tag">li</span><span class="hljs-selector-pseudo">:not(.red)</span><span class="hljs-selector-pseudo">:not(.green)</span>{}

View File

@@ -0,0 +1,2 @@
li:not(.red){}
li:not(.red):not(.green){}

View File

@@ -0,0 +1,45 @@
<span class="hljs-keyword">@-ms-keyframes</span> example {
<span class="hljs-selector-tag">from</span> {<span class="hljs-attribute">background-color</span>: red;}
<span class="hljs-selector-tag">to</span> {<span class="hljs-attribute">background-color</span>: yellow;}
}
<span class="hljs-keyword">@-o-keyframes</span> example {
<span class="hljs-selector-tag">from</span> {<span class="hljs-attribute">background-color</span>: red;}
<span class="hljs-selector-tag">to</span> {<span class="hljs-attribute">background-color</span>: yellow;}
}
<span class="hljs-selector-tag">div</span><span class="hljs-selector-class">.cls</span> {
<span class="hljs-attribute">color</span>: <span class="hljs-built_in">rgba</span>(<span class="hljs-number">51</span>, <span class="hljs-number">170</span>, <span class="hljs-number">51</span>, .<span class="hljs-number">1</span>);
<span class="hljs-attribute">width</span>: <span class="hljs-built_in">calc</span>(<span class="hljs-number">100%</span> - <span class="hljs-number">80px</span>);
<span class="hljs-attribute">transform</span>: <span class="hljs-built_in">rotate</span>(<span class="hljs-number">45deg</span>);
}
<span class="hljs-selector-tag">img</span> {
<span class="hljs-attribute">filter</span>: <span class="hljs-built_in">grayscale</span>(<span class="hljs-number">0.5</span>) <span class="hljs-built_in">blur</span>(<span class="hljs-number">10px</span>);
}
<span class="hljs-selector-tag">a</span><span class="hljs-selector-attr">[href*=<span class="hljs-string">"example"</span>]</span>, * <span class="hljs-selector-attr">[lang^=en]</span> {
<span class="hljs-attribute">font-size</span>: <span class="hljs-number">2em</span>;
}
<span class="hljs-keyword">@supports</span> (<span class="hljs-attribute">display:</span> flex) {
<span class="hljs-keyword">@media</span> screen <span class="hljs-keyword">and</span> (<span class="hljs-attribute">min-width:</span> <span class="hljs-number">900px</span>) {
<span class="hljs-selector-tag">article</span> {
<span class="hljs-attribute">display</span>: flex;
}
}
}
<span class="hljs-keyword">@media</span> <span class="hljs-keyword">only</span> screen <span class="hljs-keyword">and</span> (<span class="hljs-attribute">orientation:</span> landscape) {
<span class="hljs-selector-tag">body</span> {
<span class="hljs-attribute">background-color</span>: lightblue;
}
}
<span class="hljs-keyword">@page</span> <span class="hljs-selector-pseudo">:first</span> {
<span class="hljs-attribute">margin</span>: <span class="hljs-number">2cm</span>;
}
<span class="hljs-keyword">@font-face</span> {
<span class="hljs-attribute">font-family</span>: <span class="hljs-string">"Open Sans"</span>;
<span class="hljs-attribute">src</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">"/fonts/OpenSans-Regular-webfont.woff2"</span>) <span class="hljs-built_in">format</span>(<span class="hljs-string">"woff2"</span>),
<span class="hljs-built_in">url</span>(<span class="hljs-string">"/fonts/OpenSans-Regular-webfont.woff"</span>) <span class="hljs-built_in">format</span>(<span class="hljs-string">"woff"</span>);
}

View File

@@ -0,0 +1,45 @@
@-ms-keyframes example {
from {background-color: red;}
to {background-color: yellow;}
}
@-o-keyframes example {
from {background-color: red;}
to {background-color: yellow;}
}
div.cls {
color: rgba(51, 170, 51, .1);
width: calc(100% - 80px);
transform: rotate(45deg);
}
img {
filter: grayscale(0.5) blur(10px);
}
a[href*="example"], * [lang^=en] {
font-size: 2em;
}
@supports (display: flex) {
@media screen and (min-width: 900px) {
article {
display: flex;
}
}
}
@media only screen and (orientation: landscape) {
body {
background-color: lightblue;
}
}
@page :first {
margin: 2cm;
}
@font-face {
font-family: "Open Sans";
src: url("/fonts/OpenSans-Regular-webfont.woff2") format("woff2"),
url("/fonts/OpenSans-Regular-webfont.woff") format("woff");
}

View File

@@ -0,0 +1,6 @@
<span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">background</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">"foo/bar/baz.jpg"</span>) }
<span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">background</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">'foo/bar/baz.jpg'</span>) }
<span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">background</span>: <span class="hljs-built_in">url</span>(foo/bar/baz.jpg) }
<span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">background-image</span>: <span class="hljs-built_in">url</span>(data:image/png;base64,TWFuIGlzIGRpc3=) }
<span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">background-image</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">"data:image/png;base64,TWFuIGlzIGRpc3="</span>) }
<span class="hljs-selector-tag">div</span> { <span class="hljs-attribute">background-image</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">'data:image/png;base64,TWFuIGlzIGRpc3='</span>) }

View File

@@ -0,0 +1,6 @@
div { background: url("foo/bar/baz.jpg") }
div { background: url('foo/bar/baz.jpg') }
div { background: url(foo/bar/baz.jpg) }
div { background-image: url(data:image/png;base64,TWFuIGlzIGRpc3=) }
div { background-image: url("data:image/png;base64,TWFuIGlzIGRpc3=") }
div { background-image: url('data:image/png;base64,TWFuIGlzIGRpc3=') }

View File

@@ -0,0 +1,9 @@
<span class="hljs-comment">/// <span class="markdown">Comment.</span></span>
<span class="hljs-comment">/// <span class="markdown">Comment 2.</span></span>
<span class="hljs-comment">/// <span class="markdown"><span class="hljs-code">```dart</span></span></span>
<span class="hljs-comment">/// <span class="markdown"><span class="hljs-code">code;</span></span></span>
<span class="hljs-comment">/// <span class="markdown"><span class="hljs-code">```</span></span></span>
<span class="hljs-comment">/// <span class="markdown">text.</span></span>
<span class="hljs-comment">/// <span class="markdown">Comment 3.</span></span>

View File

@@ -0,0 +1,9 @@
/// Comment.
/// Comment 2.
/// ```dart
/// code;
/// ```
/// text.
/// Comment 3.

View File

@@ -0,0 +1,3 @@
<span class="hljs-string">'1234<span class="hljs-subst">$identifier</span> <span class="hljs-subst">$true</span>'</span>;
<span class="hljs-comment">// comment</span>
<span class="hljs-string">'1234<span class="hljs-subst">${<span class="hljs-number">1234</span> + <span class="hljs-keyword">true</span> + <span class="hljs-string">'foo'</span>}</span>'</span>;

View File

@@ -0,0 +1,3 @@
'1234$identifier $true';
// comment
'1234${1234 + true + 'foo'}';

View File

@@ -0,0 +1,4 @@
<span class="hljs-comment">{ Compiler directives }</span>
<span class="hljs-meta">{$I}</span> <span class="hljs-meta">(*$I*)</span>
<span class="hljs-function"><span class="hljs-keyword">procedure</span> <span class="hljs-title">A</span><span class="hljs-params">(x: <span class="hljs-meta">{$IFDEF Debug}</span>Integer<span class="hljs-meta">{$ELSE}</span>Word<span class="hljs-meta">{$ENDIF}</span>)</span>;</span>
<span class="hljs-keyword">begin</span> <span class="hljs-keyword">end</span>;

View File

@@ -0,0 +1,4 @@
{ Compiler directives }
{$I} (*$I*)
procedure A(x: {$IFDEF Debug}Integer{$ELSE}Word{$ENDIF});
begin end;

View File

@@ -0,0 +1,10 @@
<span class="hljs-comment">Index: languages/demo.js</span>
<span class="hljs-comment">===================================================================</span>
<span class="hljs-comment">--- languages/demo.js (revision 199)</span>
<span class="hljs-comment">+++ languages/demo.js (revision 200)</span>
<span class="hljs-meta">@@ -1,8 +1,7 @@</span>
<span class="hljs-addition">+ Here we highlight correctly</span>
<span class="hljs-comment">====</span>
<span class="hljs-addition">+ Here too</span>
<span class="hljs-comment">=====</span>
<span class="hljs-addition">+ Here we don't anymore after five '=' next to each other</span>

View File

@@ -0,0 +1,10 @@
Index: languages/demo.js
===================================================================
--- languages/demo.js (revision 199)
+++ languages/demo.js (revision 200)
@@ -1,8 +1,7 @@
+ Here we highlight correctly
====
+ Here too
=====
+ Here we don't anymore after five '=' next to each other

View File

@@ -0,0 +1,23 @@
<span class="hljs-keyword">FROM</span> ubuntu
<span class="hljs-keyword">MAINTAINER</span> laurent@docker.com
<span class="hljs-keyword">ARG</span> debug=<span class="hljs-number">0</span>
<span class="hljs-keyword">COPY</span><span class="bash"> www.conf /etc/php5/fpm/pool.d/</span>
<span class="hljs-keyword">RUN</span><span class="bash"> apt-get update \
&amp;&amp; apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql</span>
<span class="hljs-keyword">RUN</span><span class="bash"> mkdir /tmp/sessions</span>
<span class="hljs-keyword">ENV</span> APPLICATION_ENV dev
<span class="hljs-keyword">USER</span> www-data
<span class="hljs-keyword">EXPOSE</span> <span class="hljs-number">80</span>
<span class="hljs-keyword">VOLUME</span><span class="bash"> [<span class="hljs-string">"/var/www/html"</span>]</span>
<span class="hljs-keyword">WORKDIR</span><span class="bash"> <span class="hljs-string">"/var/www/html"</span></span>
<span class="hljs-keyword">CMD</span><span class="bash"> [ <span class="hljs-string">"/usr/sbin/php5-fpm"</span>, <span class="hljs-string">"-F"</span> ]</span>

View File

@@ -0,0 +1,23 @@
FROM ubuntu
MAINTAINER laurent@docker.com
ARG debug=0
COPY www.conf /etc/php5/fpm/pool.d/
RUN apt-get update \
&& apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql
RUN mkdir /tmp/sessions
ENV APPLICATION_ENV dev
USER www-data
EXPOSE 80
VOLUME ["/var/www/html"]
WORKDIR "/var/www/html"
CMD [ "/usr/sbin/php5-fpm", "-F" ]

View File

@@ -0,0 +1,3 @@
<span class="hljs-comment">rem comment</span>
<span class="hljs-comment"> rem comment</span>
<span class="hljs-built_in">copy</span> a.txt b.txt &gt; <span class="hljs-built_in">rem</span> not_a_comment

View File

@@ -0,0 +1,3 @@
rem comment
rem comment
copy a.txt b.txt > rem not_a_comment

View File

@@ -0,0 +1,24 @@
<span class="hljs-comment"># Quoted and unquoted properties</span>
<span class="hljs-keyword">dsconfig</span> <span class="hljs-built_in">create-client-connection-policy</span> \
<span class="hljs-built_in">--policy-name</span> <span class="hljs-string">"Restrictive Client Connection Policy"</span> \
<span class="hljs-built_in">--set</span> <span class="hljs-string">"description:Restrictive Client Connection Policy"</span> \
<span class="hljs-built_in">--set</span> <span class="hljs-string">enabled:true </span><span class="hljs-built_in">--set</span> <span class="hljs-string">evaluation-order-index:1000 </span>\
<span class="hljs-built_in">--set</span> <span class="hljs-string">"connection-criteria:User.0 Connection Criteria"</span> \
<span class="hljs-built_in">--set</span> <span class="hljs-string">maximum-concurrent-connections:2 </span>\
<span class="hljs-built_in">--set</span> <span class="hljs-string">"maximum-connection-duration:1 s"</span> \
<span class="hljs-built_in">--set</span> <span class="hljs-string">"maximum-idle-connection-duration:1 s"</span> \
<span class="hljs-built_in">--set</span> <span class="hljs-string">maximum-operation-count-per-connection:1000
</span><span class="hljs-comment"># dsconfig keyword is optional</span>
<span class="hljs-built_in">create-client-connection-policy</span> \
<span class="hljs-built_in">--policy-name</span> <span class="hljs-string">"Another Client Connection Policy"</span> \
<span class="hljs-built_in">--set</span> <span class="hljs-string">enabled:true </span><span class="hljs-built_in">--set</span> <span class="hljs-string">evaluation-order-index:100 </span>\
<span class="hljs-built_in">--set</span> <span class="hljs-string">'connection-criteria:User.1 Connection Criteria'</span> \
<span class="hljs-comment"># Property without value</span>
<span class="hljs-built_in">--reset</span> <span class="hljs-string">maximum-concurrent-</span><span class="hljs-string">connections
</span><span class="hljs-comment"># Unquoted property, quoted property value</span>
<span class="hljs-keyword">dsconfig</span> <span class="hljs-built_in">set-access-control-handler-prop</span> \
<span class="hljs-built_in">--add</span> <span class="hljs-string">global-aci:</span><span class="hljs-string">'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)'</span> \
<span class="hljs-built_in">--add</span> <span class="hljs-string">global-aci:</span><span class="hljs-string">'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)'</span> \
<span class="hljs-built_in">--remove</span> <span class="hljs-string">global-aci:</span><span class="hljs-string">'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)'</span>
<span class="hljs-comment"># No continuation</span>
<span class="hljs-keyword">dsconfig</span> <span class="hljs-built_in">delete-log-publisher</span> <span class="hljs-built_in">--publisher-name</span> <span class="hljs-string">"File-Based Error Logger"</span>

View File

@@ -0,0 +1,24 @@
# Quoted and unquoted properties
dsconfig create-client-connection-policy \
--policy-name "Restrictive Client Connection Policy" \
--set "description:Restrictive Client Connection Policy" \
--set enabled:true --set evaluation-order-index:1000 \
--set "connection-criteria:User.0 Connection Criteria" \
--set maximum-concurrent-connections:2 \
--set "maximum-connection-duration:1 s" \
--set "maximum-idle-connection-duration:1 s" \
--set maximum-operation-count-per-connection:1000
# dsconfig keyword is optional
create-client-connection-policy \
--policy-name "Another Client Connection Policy" \
--set enabled:true --set evaluation-order-index:100 \
--set 'connection-criteria:User.1 Connection Criteria' \
# Property without value
--reset maximum-concurrent-connections
# Unquoted property, quoted property value
dsconfig set-access-control-handler-prop \
--add global-aci:'(target="ldap:///cn=config")(targetattr="*")(version 3.0; acl "Allow access to the config tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \
--add global-aci:'(target="ldap:///cn=monitor")(targetattr="*")(version 3.0; acl "Allow access to the monitor tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)' \
--remove global-aci:'(target="ldap:///cn=alerts")(targetattr="*")(version 3.0; acl "Allow access to the alerts tree by cn=admin,c=us"; allow(all) groupdn="ldap:///cn=directory administrators,ou=groups,c=us";)'
# No continuation
dsconfig delete-log-publisher --publisher-name "File-Based Error Logger"

View File

@@ -0,0 +1,8 @@
<span class="hljs-attribute">first_quote_symbol</span> = <span class="hljs-string">"'"</span> .
<span class="hljs-attribute">second_quote_symbol</span> = <span class="hljs-string">'"'</span> .
<span class="hljs-comment">(* escaped_quote_symbol tests backticks, which does not interfere
* with backslashes. It has precedent in some language
* specifications.
*)</span>
<span class="hljs-attribute">escaped_quote_symbol</span> = <span class="hljs-string">`\`</span> ( first_quote_symbol | second_quote_symbol ) .

View File

@@ -0,0 +1,8 @@
first_quote_symbol = "'" .
second_quote_symbol = '"' .
(* escaped_quote_symbol tests backticks, which does not interfere
* with backslashes. It has precedent in some language
* specifications.
*)
escaped_quote_symbol = `\` ( first_quote_symbol | second_quote_symbol ) .

Some files were not shown because too many files have changed in this diff Show More