Fixing brackets in code samples
Updated to latest hightlight.js
This commit is contained in:
parent
2ff95d383a
commit
8a68eb2e6e
@ -5,13 +5,13 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
@requires_authorization
|
@requires_authorization
|
||||||
def somefunc(param1='', param2=0):
|
def somefunc(param1='', param2=0):
|
||||||
r'''A docstring'''
|
r'''A docstring'''
|
||||||
if param1 > param2: # interesting
|
if param1 > param2: # interesting
|
||||||
print 'Gre\'ater'
|
print 'Gre\'ater'
|
||||||
return (param2 - param1 + 1) or None
|
return (param2 - param1 + 1) or None
|
||||||
|
|
||||||
class SomeClass:<br> pass
|
class SomeClass:<br> pass
|
||||||
|
|
||||||
>>> message = '''interpreter
|
>>> message = '''interpreter
|
||||||
... prompt'''
|
... prompt'''
|
||||||
|
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
**Ruby**
|
**Ruby**
|
||||||
|
|
||||||
class A < B; def self.create(object = User) object end end
|
class A < B; def self.create(object = User) object end end
|
||||||
class Zebra; def inspect; "X#{2 + self.object_id}" end end
|
class Zebra; def inspect; "X#{2 + self.object_id}" end end
|
||||||
|
|
||||||
module ABC::DEF
|
module ABC::DEF
|
||||||
@ -39,7 +39,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
# @return [String] nothing
|
# @return [String] nothing
|
||||||
def foo(test)
|
def foo(test)
|
||||||
Thread.new do |blockvar|
|
Thread.new do |blockvar|
|
||||||
ABC::DEF.reverse(:a_symbol, :'a symbol', :<=>, 'test' + test)
|
ABC::DEF.reverse(:a_symbol, :'a symbol', :<=>, 'test' + test)
|
||||||
end.join
|
end.join
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
!!! XML
|
!!! XML
|
||||||
%html
|
%html
|
||||||
%body
|
%body
|
||||||
%h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
|
%h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
|
||||||
/html comment
|
/html comment
|
||||||
-# ignore this line
|
-# ignore this line
|
||||||
%ul(style='margin: 0')
|
%ul(style='margin: 0')
|
||||||
@ -73,25 +73,25 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
# loads object
|
# loads object
|
||||||
sub load
|
sub load
|
||||||
{
|
{
|
||||||
my $flds = $c->db_load($id,@_) || do {
|
my $flds = $c->db_load($id,@_) || do {
|
||||||
Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef
|
Carp::carp "Can`t load (class: $c, id: $id): '$!'"; return undef
|
||||||
};
|
};
|
||||||
my $o = $c->_perl_new();
|
my $o = $c->_perl_new();
|
||||||
$id12 = $id / 24 / 3600;
|
$id12 = $id / 24 / 3600;
|
||||||
$o->{'ID'} = $id12 + 123;
|
$o->{'ID'} = $id12 + 123;
|
||||||
#$o->{'SHCUT'} = $flds->{'SHCUT'};
|
#$o->{'SHCUT'} = $flds->{'SHCUT'};
|
||||||
my $p = $o->props;
|
my $p = $o->props;
|
||||||
my $vt;
|
my $vt;
|
||||||
$string =~ m/^sought_text$/;
|
$string =~ m/^sought_text$/;
|
||||||
$items = split //, 'abc';
|
$items = split //, 'abc';
|
||||||
for my $key (keys %$p)
|
for my $key (keys %$p)
|
||||||
{
|
{
|
||||||
if(${$vt.'::property'}) {
|
if(${$vt.'::property'}) {
|
||||||
$o->{$key . '_real'} = $flds->{$key};
|
$o->{$key . '_real'} = $flds->{$key};
|
||||||
tie $o->{$key}, 'CMSBuilder::Property', $o, $key;
|
tie $o->{$key}, 'CMSBuilder::Property', $o, $key;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$o->save if delete $o->{'_save_after_load'};
|
$o->save if delete $o->{'_save_after_load'};
|
||||||
return $o;
|
return $o;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,24 +145,24 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
/** Turn command line arguments to uppercase */
|
/** Turn command line arguments to uppercase */
|
||||||
object Main {
|
object Main {
|
||||||
def main(args: Array[String]) {
|
def main(args: Array[String]) {
|
||||||
val res = for (a <- args) yield a.toUpperCase
|
val res = for (a <- args) yield a.toUpperCase
|
||||||
println("Arguments: " + res.toString)
|
println("Arguments: " + res.toString)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Maps are easy to use in Scala. */
|
/** Maps are easy to use in Scala. */
|
||||||
object Maps {
|
object Maps {
|
||||||
val colors = Map("red" -> 0xFF0000,
|
val colors = Map("red" -> 0xFF0000,
|
||||||
"turquoise" -> 0x00FFFF,
|
"turquoise" -> 0x00FFFF,
|
||||||
"black" -> 0x000000,
|
"black" -> 0x000000,
|
||||||
"orange" -> 0xFF8040,
|
"orange" -> 0xFF8040,
|
||||||
"brown" -> 0x804000)
|
"brown" -> 0x804000)
|
||||||
def main(args: Array[String]) {
|
def main(args: Array[String]) {
|
||||||
for (name <- args) println(
|
for (name <- args) println(
|
||||||
colors.get(name) match {
|
colors.get(name) match {
|
||||||
case Some(code) =>
|
case Some(code) =>
|
||||||
name + " has code: " + code
|
name + " has code: " + code
|
||||||
case None =>
|
case None =>
|
||||||
"Unknown color: " + name
|
"Unknown color: " + name
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@ -200,8 +200,8 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
ch := make(chan int)
|
ch := make(chan int)
|
||||||
ch <- 1
|
ch <- 1
|
||||||
x, ok := <- ch
|
x, ok := <- ch
|
||||||
ok = true
|
ok = true
|
||||||
x = nil
|
x = nil
|
||||||
float_var := 1.0e10
|
float_var := 1.0e10
|
||||||
@ -214,77 +214,77 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
**XML**
|
**XML**
|
||||||
|
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<response value="ok" xml:lang="en">
|
<response value="ok" xml:lang="en">
|
||||||
<text>Ok</text>
|
<text>Ok</text>
|
||||||
<comment html_allowed="true"/>
|
<comment html_allowed="true"/>
|
||||||
<ns1:description><![CDATA[
|
<ns1:description><![CDATA[
|
||||||
CDATA is <not> magical.
|
CDATA is <not> magical.
|
||||||
]]></ns1:description>
|
]]></ns1:description>
|
||||||
<a></a> <a/>
|
<a></a> <a/>
|
||||||
</response>
|
</response>
|
||||||
|
|
||||||
|
|
||||||
**HTML (with inline css and javascript)**
|
**HTML (with inline css and javascript)**
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<title>Title</title>
|
<title>Title</title>
|
||||||
|
|
||||||
<style>body {width: 500px;}</style>
|
<style>body {width: 500px;}</style>
|
||||||
|
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
function $init() {return true;}
|
function $init() {return true;}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<p checked class="title" id='title'>Title</p>
|
<p checked class="title" id='title'>Title</p>
|
||||||
<!-- here goes the rest of the page -->
|
<!-- here goes the rest of the page -->
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
**Lasso**
|
**Lasso**
|
||||||
|
|
||||||
<?LassoScript
|
<?LassoScript
|
||||||
/* Lasso 8 */
|
/* Lasso 8 */
|
||||||
local('query' = 'SELECT * FROM `'+var:'table'+'` WHERE `id` > 10
|
local('query' = 'SELECT * FROM `'+var:'table'+'` WHERE `id` > 10
|
||||||
ORDER BY `Name` LIMIT 30');
|
ORDER BY `Name` LIMIT 30');
|
||||||
Inline: -Username=$DBuser, -Password=$DBpass, -Database=$DBname, -sql=#query;
|
Inline: -Username=$DBuser, -Password=$DBpass, -Database=$DBname, -sql=#query;
|
||||||
var("class.name" = (found_count != 0 ? `subtotal` | `nonefound`));
|
var("class.name" = (found_count != 0 ? `subtotal` | `nonefound`));
|
||||||
records;
|
records;
|
||||||
output: ?><tr>[loop_count]</tr><?=;
|
output: ?><tr>[loop_count]</tr><?=;
|
||||||
/records;
|
/records;
|
||||||
/Inline;
|
/Inline;
|
||||||
?><div class="[$class.name]">[found_count]</div>
|
?><div class="[$class.name]">[found_count]</div>
|
||||||
[noprocess] causes [delimiters] to be skipped until the next [/noprocess]
|
[noprocess] causes [delimiters] to be skipped until the next [/noprocess]
|
||||||
<?lasso
|
<?lasso
|
||||||
/* Lasso 9 */
|
/* Lasso 9 */
|
||||||
define strings_combine(value::string, ...other)::string => {
|
define strings_combine(value::string, ...other)::string => {
|
||||||
local(result = #value->append(#other->asString))
|
local(result = #value->append(#other->asString))
|
||||||
return #result
|
return #result
|
||||||
}
|
}
|
||||||
/**! descriptive text */
|
/**! descriptive text */
|
||||||
define person => type {
|
define person => type {
|
||||||
data name::string, protected nickname
|
data name::string, protected nickname
|
||||||
data birthdate::date
|
data birthdate::date
|
||||||
data private ssn = null
|
data private ssn = null
|
||||||
public showName() => return .'name'
|
public showName() => return .'name'
|
||||||
protected fullName() => '"' + .nickname + '"' + .'name'
|
protected fullName() => '"' + .nickname + '"' + .'name'
|
||||||
public ssnListed => .ssn ? true | false
|
public ssnListed => .ssn ? true | false
|
||||||
}
|
}
|
||||||
define person->name=(value) => {
|
define person->name=(value) => {
|
||||||
.'name' = #value
|
.'name' = #value
|
||||||
return self->'name'
|
return self->'name'
|
||||||
}
|
}
|
||||||
// query expression
|
// query expression
|
||||||
with n in array(-1, 0xABCD, 3.14159e14)
|
with n in array(-1, 0xABCD, 3.14159e14)
|
||||||
let swapped = pair(#n->second, #n->first)
|
let swapped = pair(#n->second, #n->first)
|
||||||
group #swapped by #n->first into t
|
group #swapped by #n->first into t
|
||||||
let key = #t->key
|
let key = #t->key
|
||||||
order by #key
|
order by #key
|
||||||
select pair(#key, #t)
|
select pair(#key, #t)
|
||||||
do {^
|
do {^
|
||||||
#n->upperCase
|
#n->upperCase
|
||||||
^}
|
^}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
**Markdown**
|
**Markdown**
|
||||||
|
|
||||||
@ -300,9 +300,9 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
hello world
|
hello world
|
||||||
===========
|
===========
|
||||||
|
|
||||||
<this_is inline="xml"></this_is>
|
<this_is inline="xml"></this_is>
|
||||||
|
|
||||||
> markdown is so cool
|
> markdown is so cool
|
||||||
|
|
||||||
so are code segments
|
so are code segments
|
||||||
|
|
||||||
@ -313,7 +313,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
Hello, World!
|
Hello, World!
|
||||||
============
|
============
|
||||||
Author Name, <author@domain.foo>
|
Author Name, <author@domain.foo>
|
||||||
|
|
||||||
you can write text http://example.com[with links], optionally
|
you can write text http://example.com[with links], optionally
|
||||||
using an explicit link:http://example.com[link prefix].
|
using an explicit link:http://example.com[link prefix].
|
||||||
@ -347,7 +347,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
.Nested highlighting
|
.Nested highlighting
|
||||||
++++
|
++++
|
||||||
<this_is inline="xml"></this_is>
|
<this_is inline="xml"></this_is>
|
||||||
++++
|
++++
|
||||||
|
|
||||||
____
|
____
|
||||||
@ -381,10 +381,10 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
{% for article in articles %}
|
{% for article in articles %}
|
||||||
|
|
||||||
{# Striped table #}
|
{# Striped table #}
|
||||||
<tr class="{% cycle odd,even %}">
|
<tr class="{% cycle odd,even %}">
|
||||||
<td>{{ article|default:"Hi... "|escape }}</td>
|
<td>{{ article|default:"Hi... "|escape }}</td>
|
||||||
<td {% if article.today %}class="today"{% endif %}>{{ article.date|date:"d.m.Y" }}</td>
|
<td {% if article.today %}class="today"{% endif %}>{{ article.date|date:"d.m.Y" }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -396,13 +396,13 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
**Handlebars**
|
**Handlebars**
|
||||||
|
|
||||||
<h3>Hours</h3>
|
<h3>Hours</h3>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
{{#each content.users}}
|
{{#each content.users}}
|
||||||
<li {{bindAttr hello="world"}}>{{firstName}}</li>
|
<li {{bindAttr hello="world"}}>{{firstName}}</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
**CSS**
|
**CSS**
|
||||||
|
|
||||||
@ -492,8 +492,8 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
a {
|
a {
|
||||||
color: $colorGreen;
|
color: $colorGreen;
|
||||||
&:hover { color: $colorGreenDark; }
|
&:hover { color: $colorGreenDark; }
|
||||||
&:visited { color: #c458cb; }
|
&:visited { color: #c458cb; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@for $i from 1 through 5 {
|
@for $i from 1 through 5 {
|
||||||
@ -533,10 +533,10 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
/* handle exception */
|
/* handle exception */
|
||||||
|
|
||||||
var e4x =
|
var e4x =
|
||||||
<div>Example
|
<div>Example
|
||||||
<p>1234</p></div>;
|
<p>1234</p></div>;
|
||||||
}
|
}
|
||||||
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp
|
for (var i = 0 / 2; i < classes.length; i++) { // "0 / 2" should not be parsed as regexp
|
||||||
if (checkCondition(classes[i]) === undefined)
|
if (checkCondition(classes[i]) === undefined)
|
||||||
return /\d+[\s/]/g;
|
return /\d+[\s/]/g;
|
||||||
}
|
}
|
||||||
@ -558,7 +558,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
x = f /foo * 2/gm
|
x = f /foo * 2/gm
|
||||||
x = if true then /\n/ else /[.,]+/
|
x = if true then /\n/ else /[.,]+/
|
||||||
|
|
||||||
grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
|
grade = (student, period=(if b? then 7 else 6), messages={"A": "Excellent"}) ->
|
||||||
if student.excellentWork
|
if student.excellentWork
|
||||||
"A+"
|
"A+"
|
||||||
else if student.okayStuff
|
else if student.okayStuff
|
||||||
@ -638,7 +638,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
s = trim(ini_strings(i))
|
s = trim(ini_strings(i))
|
||||||
|
|
||||||
' skipping empty strings and comments
|
' skipping empty strings and comments
|
||||||
if mid(s, 1, 1) <> "#" and len(s) > 0 then
|
if mid(s, 1, 1) <> "#" and len(s) > 0 then
|
||||||
' obtaining key and value
|
' obtaining key and value
|
||||||
parts = split(s, "=", -1, 1)
|
parts = split(s, "=", -1, 1)
|
||||||
|
|
||||||
@ -667,14 +667,14 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
#Const DEBUG = True
|
#Const DEBUG = True
|
||||||
|
|
||||||
Namespace Highlighter.Test
|
Namespace Highlighter.Test
|
||||||
''' <summary>This is an example class.</summary>
|
''' <summary>This is an example class.</summary>
|
||||||
Public Class Program
|
Public Class Program
|
||||||
Protected Shared hello As Integer = 3
|
Protected Shared hello As Integer = 3
|
||||||
Private Const ABC As Boolean = False
|
Private Const ABC As Boolean = False
|
||||||
|
|
||||||
#Region "Code"
|
#Region "Code"
|
||||||
' Cheers!
|
' Cheers!
|
||||||
<STAThread()> _
|
<STAThread()> _
|
||||||
Public Shared Sub Main(ByVal args() As String, ParamArray arr As Object) Handles Form1.Click
|
Public Shared Sub Main(ByVal args() As String, ParamArray arr As Object) Handles Form1.Click
|
||||||
On Error Resume Next
|
On Error Resume Next
|
||||||
If ABC Then
|
If ABC Then
|
||||||
@ -689,7 +689,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
End Try
|
End Try
|
||||||
Next
|
Next
|
||||||
Else
|
Else
|
||||||
Dim l As New System.Collections.List<String>()
|
Dim l As New System.Collections.List<String>()
|
||||||
SyncLock l
|
SyncLock l
|
||||||
If TypeOf l Is Decimal And l IsNot Nothing Then
|
If TypeOf l Is Decimal And l IsNot Nothing Then
|
||||||
RemoveHandler button1.Paint, delegate
|
RemoveHandler button1.Paint, delegate
|
||||||
@ -793,7 +793,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
Repeat
|
Repeat
|
||||||
ReadBufSize:=InFile.Read(Buffer,BufSize);
|
ReadBufSize:=InFile.Read(Buffer,BufSize);
|
||||||
OutFile.Write(Buffer,ReadBufSize);
|
OutFile.Write(Buffer,ReadBufSize);
|
||||||
Until ReadBufSize<>BufSize;
|
Until ReadBufSize<>BufSize;
|
||||||
Log('File '''+InFileName+''' copied'#13#10);
|
Log('File '''+InFileName+''' copied'#13#10);
|
||||||
Finally
|
Finally
|
||||||
InFile.Free;
|
InFile.Free;
|
||||||
@ -804,7 +804,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
**Java**
|
**Java**
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author John Smith <john.smith@example.com>
|
* @author John Smith <john.smith@example.com>
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
package l2f.gameserver.model;
|
package l2f.gameserver.model;
|
||||||
@ -817,7 +817,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
public void moveTo(int x, int y, int z) {
|
public void moveTo(int x, int y, int z) {
|
||||||
_ai = null;
|
_ai = null;
|
||||||
_log.warning("Should not be called");
|
_log.warning("Should not be called");
|
||||||
if (1 > 5) {
|
if (1 > 5) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -839,16 +839,16 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
**C++**
|
**C++**
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
/* An annoying "Hello World" example */
|
/* An annoying "Hello World" example */
|
||||||
for (auto i = 0; i < 0xFFFF; i++)
|
for (auto i = 0; i < 0xFFFF; i++)
|
||||||
cout << "Hello, World!" << endl;
|
cout << "Hello, World!" << endl;
|
||||||
|
|
||||||
char c = '\n';
|
char c = '\n';
|
||||||
unordered_map <string, vector<string> > m;
|
unordered_map <string, vector<string> > m;
|
||||||
m["key"] = "\\\\"; // this is an error
|
m["key"] = "\\\\"; // this is an error
|
||||||
|
|
||||||
return -2e3 + 12l;
|
return -2e3 + 12l;
|
||||||
@ -856,7 +856,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
**Objective C**
|
**Objective C**
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
#import "Dependency.h"
|
#import "Dependency.h"
|
||||||
|
|
||||||
@protocol WorldDataSource
|
@protocol WorldDataSource
|
||||||
@ -866,7 +866,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
- (BOOL)allowsToLive;
|
- (BOOL)allowsToLive;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface Test : NSObject <HelloDelegate, WorldDataSource> {
|
@interface Test : NSObject <HelloDelegate, WorldDataSource> {
|
||||||
NSString *_greeting;
|
NSString *_greeting;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -927,7 +927,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
var t = new Track(); // same as: Track t = new Track();
|
var t = new Track(); // same as: Track t = new Track();
|
||||||
var s = "hello"; // same as: string s = "hello";
|
var s = "hello"; // same as: string s = "hello";
|
||||||
var l = new List<int>(); // same as: List<int> l = new List<int>();
|
var l = new List<int>(); // same as: List<int> l = new List<int>();
|
||||||
var i = 10; // same as: int i = 10;
|
var i = 10; // same as: int i = 10;
|
||||||
|
|
||||||
|
|
||||||
@ -957,7 +957,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
public class Program
|
public class Program
|
||||||
{
|
{
|
||||||
/// <summary>The entry point to the program.</summary>
|
/// <summary>The entry point to the program.</summary>
|
||||||
public static int Main(string[] args)
|
public static int Main(string[] args)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Hello, World!");
|
Console.WriteLine("Hello, World!");
|
||||||
@ -970,7 +970,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async Task<int> AccessTheWebAsync()
|
async Task<int> AccessTheWebAsync()
|
||||||
{
|
{
|
||||||
// ...
|
// ...
|
||||||
string urlContents = await getStringTask;
|
string urlContents = await getStringTask;
|
||||||
@ -988,16 +988,16 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
*)
|
*)
|
||||||
let checkList alist =
|
let checkList alist =
|
||||||
match alist with
|
match alist with
|
||||||
| [] -> 0
|
| [] -> 0
|
||||||
| [a] -> 1
|
| [a] -> 1
|
||||||
| [a; b] -> 2
|
| [a; b] -> 2
|
||||||
| [a; b; c] -> 3
|
| [a; b; c] -> 3
|
||||||
| _ -> failwith "List is too big!"
|
| _ -> failwith "List is too big!"
|
||||||
|
|
||||||
|
|
||||||
type IEncoding =
|
type IEncoding =
|
||||||
abstract Encode : string -> string
|
abstract Encode : string -> string
|
||||||
abstract Decode : string -> string
|
abstract Decode : string -> string
|
||||||
|
|
||||||
let text = "Some text..."
|
let text = "Some text..."
|
||||||
let text2 = @"A ""verbatim"" string..."
|
let text2 = @"A ""verbatim"" string..."
|
||||||
@ -1005,18 +1005,18 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
Some "long" string...
|
Some "long" string...
|
||||||
"""
|
"""
|
||||||
|
|
||||||
let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2)
|
let rec fib x = if x <= 2 then 1 else fib(x-1) + fib(x-2)
|
||||||
|
|
||||||
let fibs =
|
let fibs =
|
||||||
Async.Parallel [ for i in 0..40 -> async { return fib(i) } ]
|
Async.Parallel [ for i in 0..40 -> async { return fib(i) } ]
|
||||||
|> Async.RunSynchronously
|
|> Async.RunSynchronously
|
||||||
|
|
||||||
type Sprocket(gears) =
|
type Sprocket(gears) =
|
||||||
member this.Gears : int = gears
|
member this.Gears : int = gears
|
||||||
|
|
||||||
[<AbstractClass>]
|
[<AbstractClass>]
|
||||||
type Animal =
|
type Animal =
|
||||||
abstract Speak : unit -> unit
|
abstract Speak : unit -> unit
|
||||||
|
|
||||||
type Widget =
|
type Widget =
|
||||||
| RedWidget
|
| RedWidget
|
||||||
@ -1024,9 +1024,9 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
type Point = {X: float; Y: float;}
|
type Point = {X: float; Y: float;}
|
||||||
|
|
||||||
[<Measure>]
|
[<Measure>]
|
||||||
type s
|
type s
|
||||||
let minutte = 60<s>
|
let minutte = 60<s>
|
||||||
|
|
||||||
**D**
|
**D**
|
||||||
|
|
||||||
@ -1041,7 +1041,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
enum COMPILED_ON = __TIMESTAMP__; // special token
|
enum COMPILED_ON = __TIMESTAMP__; // special token
|
||||||
|
|
||||||
enum character = '©';
|
enum character = '©';
|
||||||
enum copy_valid = '&copy;';
|
enum copy_valid = '©';
|
||||||
enum backslash_escaped = '\\';
|
enum backslash_escaped = '\\';
|
||||||
|
|
||||||
// string literals
|
// string literals
|
||||||
@ -1097,7 +1097,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
FrameBegin 0
|
FrameBegin 0
|
||||||
Display "Scene" "framebuffer" "rgb"
|
Display "Scene" "framebuffer" "rgb"
|
||||||
Option "searchpath" "shader" "+&:/home/kew"
|
Option "searchpath" "shader" "+&:/home/kew"
|
||||||
Option "trace" "int maxdepth" [4]
|
Option "trace" "int maxdepth" [4]
|
||||||
Attribute "visibility" "trace" [1]
|
Attribute "visibility" "trace" [1]
|
||||||
Attribute "irradiance" "maxerror" [0.1]
|
Attribute "irradiance" "maxerror" [0.1]
|
||||||
@ -1137,7 +1137,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
string $class[] = getClassification( `nodeType $shape` );
|
string $class[] = getClassification( `nodeType $shape` );
|
||||||
|
|
||||||
|
|
||||||
if ( ( `size $class` ) > 0 && ( "light" == $class[0] ) )
|
if ( ( `size $class` ) > 0 && ( "light" == $class[0] ) )
|
||||||
{
|
{
|
||||||
$selectedLights[ `size $selectedLights` ] = $shape;
|
$selectedLights[ `size $selectedLights` ] = $shape;
|
||||||
}
|
}
|
||||||
@ -1170,7 +1170,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
layout(triangle_strip, max_vertices = 3) out;
|
layout(triangle_strip, max_vertices = 3) out;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
for(int i = 0; i < gl_in.length(); i++) {
|
for(int i = 0; i < gl_in.length(); i++) {
|
||||||
gl_Position = gl_in[i].gl_Position;
|
gl_Position = gl_in[i].gl_Position;
|
||||||
EmitVertex();
|
EmitVertex();
|
||||||
}
|
}
|
||||||
@ -1209,7 +1209,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
**SmallTalk**
|
**SmallTalk**
|
||||||
|
|
||||||
Object>>method: num
|
Object>>method: num
|
||||||
"comment 123"
|
"comment 123"
|
||||||
| var1 var2 |
|
| var1 var2 |
|
||||||
(1 to: num) do: [:i | |var| ^i].
|
(1 to: num) do: [:i | |var| ^i].
|
||||||
@ -1257,7 +1257,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
"Prompts
|
"Prompts
|
||||||
for CD"
|
for CD"
|
||||||
(prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6))
|
(prompt-read "Title" 1.53 1 2/4 1.7 1.7e0 2.9E-4 +42 -7 #b001 #b001/100 #o777 #O777 #xabc55 #c(0 -5.6))
|
||||||
(prompt-read "Artist" &rest)
|
(prompt-read "Artist" &rest)
|
||||||
(or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
|
(or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
|
||||||
(if x (format t "yes") (format t "no" nil) ;and here comment
|
(if x (format t "yes") (format t "no" nil) ;and here comment
|
||||||
)
|
)
|
||||||
@ -1287,11 +1287,11 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
(def
|
(def
|
||||||
^{:macro true
|
^{:macro true
|
||||||
:added "1.0"}
|
:added "1.0"}
|
||||||
let (fn* let [&form &env & decl] (cons 'let* decl)))
|
let (fn* let [&form &env & decl] (cons 'let* decl)))
|
||||||
|
|
||||||
(def
|
(def
|
||||||
|
|
||||||
defn (fn defn [&form &env name & fdecl]
|
defn (fn defn [&form &env name & fdecl]
|
||||||
(let [m (conj {:arglists (list 'quote (sigs fdecl))} m)
|
(let [m (conj {:arglists (list 'quote (sigs fdecl))} m)
|
||||||
m (let [inline (:inline m)
|
m (let [inline (:inline m)
|
||||||
ifn (first inline)
|
ifn (first inline)
|
||||||
@ -1337,13 +1337,13 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
ExpiresActive On
|
ExpiresActive On
|
||||||
ExpiresByType application/x-javascript "access plus 1 days"
|
ExpiresByType application/x-javascript "access plus 1 days"
|
||||||
|
|
||||||
<Location /maps/>
|
<Location /maps/>
|
||||||
RewriteMap map txt:map.txt
|
RewriteMap map txt:map.txt
|
||||||
RewriteMap lower int:tolower
|
RewriteMap lower int:tolower
|
||||||
RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
|
RewriteCond %{REQUEST_URI} ^/([^/.]+)\.html$ [NC]
|
||||||
RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
|
RewriteCond ${map:${lower:%1}|NOT_FOUND} !NOT_FOUND
|
||||||
RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
|
RewriteRule .? /index.php?q=${map:${lower:%1}} [NC,L]
|
||||||
</Location>
|
</Location>
|
||||||
|
|
||||||
**nginx**
|
**nginx**
|
||||||
|
|
||||||
@ -1653,25 +1653,25 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
subtype RS is std_logic_vector (1 downto 0);
|
subtype RS is std_logic_vector (1 downto 0);
|
||||||
begin
|
begin
|
||||||
if reset = '0' then
|
if reset = '0' then
|
||||||
QT <= '0';
|
QT <= '0';
|
||||||
else
|
else
|
||||||
if rising_edge(C) then
|
if rising_edge(C) then
|
||||||
if not (R'stable(T) and S'stable(T)) then
|
if not (R'stable(T) and S'stable(T)) then
|
||||||
QT <= 'X';
|
QT <= 'X';
|
||||||
else
|
else
|
||||||
case RS'(R&S) is
|
case RS'(R&S) is
|
||||||
when "01" => QT <= '1';
|
when "01" => QT <= '1';
|
||||||
when "10" => QT <= '0';
|
when "10" => QT <= '0';
|
||||||
when "11" => QT <= 'X';
|
when "11" => QT <= 'X';
|
||||||
when others => null;
|
when others => null;
|
||||||
end case;
|
end case;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end if;
|
end if;
|
||||||
end process;
|
end process;
|
||||||
|
|
||||||
Q <= QT;
|
Q <= QT;
|
||||||
nQ <= not QT;
|
nQ <= not QT;
|
||||||
end architecture behaviour;
|
end architecture behaviour;
|
||||||
|
|
||||||
**Parser 3**
|
**Parser 3**
|
||||||
@ -1689,7 +1689,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
@create[aParam1;aParam2][local1;local2]
|
@create[aParam1;aParam2][local1;local2]
|
||||||
^connect[mysql://host/database?ClientCharset=windows-1251]
|
^connect[mysql://host/database?ClientCharset=windows-1251]
|
||||||
^for[i](1;10){
|
^for[i](1;10){
|
||||||
<p class="paragraph">^eval($i+10)</p>
|
<p class="paragraph">^eval($i+10)</p>
|
||||||
^connect[mysql://host/database]{
|
^connect[mysql://host/database]{
|
||||||
$tab[^table::sql{select * from `table` where a='1'}]
|
$tab[^table::sql{select * from `table` where a='1'}]
|
||||||
$var_Name[some${value}]
|
$var_Name[some${value}]
|
||||||
@ -1722,7 +1722,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
\begin{document}
|
\begin{document}
|
||||||
\section*{Highlight.js}
|
\section*{Highlight.js}
|
||||||
\begin{table}[c|c]
|
\begin{table}[c|c]
|
||||||
$\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $
|
$\frac 12\, + \, \frac 1{x^3}\text{Hello \! world}$ & \textbf{Goodbye\~ world} \\\eTiX $ \pi=400 $
|
||||||
\end{table}
|
\end{table}
|
||||||
Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b
|
Ch\'erie, \c{c}a ne me pla\^\i t pas! % comment \b
|
||||||
G\"otterd\"ammerung~45\%=34.
|
G\"otterd\"ammerung~45\%=34.
|
||||||
@ -1754,8 +1754,8 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
-- Type class for converting StringLike types to and from strict ByteStrings
|
-- Type class for converting StringLike types to and from strict ByteStrings
|
||||||
class DataPacket a where
|
class DataPacket a where
|
||||||
toStrictBS :: a -> Strict.ByteString
|
toStrictBS :: a -> Strict.ByteString
|
||||||
fromStrictBS :: Strict.ByteString -> a
|
fromStrictBS :: Strict.ByteString -> a
|
||||||
|
|
||||||
instance DataPacket Strict.ByteString where
|
instance DataPacket Strict.ByteString where
|
||||||
toStrictBS = id
|
toStrictBS = id
|
||||||
@ -1763,16 +1763,16 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
fromStrictBS = id
|
fromStrictBS = id
|
||||||
{-# INLINE fromStrictBS #-}
|
{-# INLINE fromStrictBS #-}
|
||||||
|
|
||||||
openBoundUDPPort :: String -> Int -> IO Socket
|
openBoundUDPPort :: String -> Int -> IO Socket
|
||||||
openBoundUDPPort uri port = do
|
openBoundUDPPort uri port = do
|
||||||
s <- getUDPSocket
|
s <- getUDPSocket
|
||||||
bindAddr <- inet_addr uri
|
bindAddr <- inet_addr uri
|
||||||
let a = SockAddrInet (toEnum port) bindAddr
|
let a = SockAddrInet (toEnum port) bindAddr
|
||||||
bindSocket s a
|
bindSocket s a
|
||||||
return s
|
return s
|
||||||
|
|
||||||
pingUDPPort :: Socket -> SockAddr -> IO ()
|
pingUDPPort :: Socket -> SockAddr -> IO ()
|
||||||
pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return ()
|
pingUDPPort s a = sendTo s (Strict.singleton 0) a >> return ()
|
||||||
|
|
||||||
**Erlang**
|
**Erlang**
|
||||||
|
|
||||||
@ -1790,36 +1790,36 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
channel
|
channel
|
||||||
}).
|
}).
|
||||||
|
|
||||||
test(Foo)->Foo.
|
test(Foo)->Foo.
|
||||||
|
|
||||||
init([Shell, Exec]) ->
|
init([Shell, Exec]) ->
|
||||||
{ok, #state{shell = Shell, exec = Exec}};
|
{ok, #state{shell = Shell, exec = Exec}};
|
||||||
init([Shell]) ->
|
init([Shell]) ->
|
||||||
false = not true,
|
false = not true,
|
||||||
io:format("Hello, \"~p!~n", [atom_to_list('World')]),
|
io:format("Hello, \"~p!~n", [atom_to_list('World')]),
|
||||||
{ok, #state{shell = Shell}}.
|
{ok, #state{shell = Shell}}.
|
||||||
|
|
||||||
concat([Single]) -> Single;
|
concat([Single]) -> Single;
|
||||||
concat(RList) ->
|
concat(RList) ->
|
||||||
EpsilonFree = lists:filter(
|
EpsilonFree = lists:filter(
|
||||||
fun (Element) ->
|
fun (Element) ->
|
||||||
case Element of
|
case Element of
|
||||||
epsilon -> false;
|
epsilon -> false;
|
||||||
_ -> true
|
_ -> true
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
RList),
|
RList),
|
||||||
case EpsilonFree of
|
case EpsilonFree of
|
||||||
[Single] -> Single;
|
[Single] -> Single;
|
||||||
Other -> {concat, Other}
|
Other -> {concat, Other}
|
||||||
end.
|
end.
|
||||||
|
|
||||||
union_dot_union({union, _}=U1, {union, _}=U2) ->
|
union_dot_union({union, _}=U1, {union, _}=U2) ->
|
||||||
union(lists:flatten(
|
union(lists:flatten(
|
||||||
lists:map(
|
lists:map(
|
||||||
fun (X1) ->
|
fun (X1) ->
|
||||||
lists:map(
|
lists:map(
|
||||||
fun (X2) ->
|
fun (X2) ->
|
||||||
concat([X1, X2])
|
concat([X1, X2])
|
||||||
end,
|
end,
|
||||||
union_to_list(U2)
|
union_to_list(U2)
|
||||||
@ -1831,32 +1831,32 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
**Erlang REPL**
|
**Erlang REPL**
|
||||||
|
|
||||||
1> Str = "abcd".
|
1> Str = "abcd".
|
||||||
"abcd"
|
"abcd"
|
||||||
2> L = test:length(Str).
|
2> L = test:length(Str).
|
||||||
4
|
4
|
||||||
3> Descriptor = {L, list_to_atom(Str)}.
|
3> Descriptor = {L, list_to_atom(Str)}.
|
||||||
{4,abcd}
|
{4,abcd}
|
||||||
4> L.
|
4> L.
|
||||||
4
|
4
|
||||||
5> b().
|
5> b().
|
||||||
Descriptor = {4,abcd}
|
Descriptor = {4,abcd}
|
||||||
L = 4
|
L = 4
|
||||||
Str = "abcd"
|
Str = "abcd"
|
||||||
ok
|
ok
|
||||||
6> f(L).
|
6> f(L).
|
||||||
ok
|
ok
|
||||||
7> b().
|
7> b().
|
||||||
Descriptor = {4,abcd}
|
Descriptor = {4,abcd}
|
||||||
Str = "abcd"
|
Str = "abcd"
|
||||||
ok
|
ok
|
||||||
8> {L, _} = Descriptor.
|
8> {L, _} = Descriptor.
|
||||||
{4,abcd}
|
{4,abcd}
|
||||||
9> L.
|
9> L.
|
||||||
4
|
4
|
||||||
10> 2#101.
|
10> 2#101.
|
||||||
5
|
5
|
||||||
11> 1.85e+3.
|
11> 1.85e+3.
|
||||||
1850
|
1850
|
||||||
|
|
||||||
**Rust**
|
**Rust**
|
||||||
@ -1879,7 +1879,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
12E+99_f64; // type f64
|
12E+99_f64; // type f64
|
||||||
|
|
||||||
/* Factorial */
|
/* Factorial */
|
||||||
fn fac(n: int) -> int {
|
fn fac(n: int) -> int {
|
||||||
let s: str = "This is
|
let s: str = "This is
|
||||||
a multi-line string.
|
a multi-line string.
|
||||||
|
|
||||||
@ -1887,39 +1887,39 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
let c: char = 'Ф';
|
let c: char = 'Ф';
|
||||||
|
|
||||||
let result = 1, i = 1;
|
let result = 1, i = 1;
|
||||||
while i <= n { // No parens around the condition
|
while i <= n { // No parens around the condition
|
||||||
result *= i;
|
result *= i;
|
||||||
i += 1;
|
i += 1;
|
||||||
}
|
}
|
||||||
ret result;
|
ret result;
|
||||||
}
|
}
|
||||||
|
|
||||||
pure fn pure_length<T>(ls: list<T>) -> uint { /* ... */ }
|
pure fn pure_length<T>(ls: list<T>) -> uint { /* ... */ }
|
||||||
|
|
||||||
type t = map::hashtbl<int,str>;
|
type t = map::hashtbl<int,str>;
|
||||||
let x = id::<int>(10);
|
let x = id::<int>(10);
|
||||||
|
|
||||||
// Define some modules.
|
// Define some modules.
|
||||||
#[path = "foo.rs"]
|
#[path = "foo.rs"]
|
||||||
mod foo;
|
mod foo;
|
||||||
|
|
||||||
iface seq<T> {
|
iface seq<T> {
|
||||||
fn len() -> uint;
|
fn len() -> uint;
|
||||||
}
|
}
|
||||||
|
|
||||||
impl <T> of seq<T> for [T] {
|
impl <T> of seq<T> for [T] {
|
||||||
fn len() -> uint { vec::len(self) }
|
fn len() -> uint { vec::len(self) }
|
||||||
fn iter(b: fn(T)) {
|
fn iter(b: fn(T)) {
|
||||||
for elt in self { b(elt); }
|
for elt in self { b(elt); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
enum list<T> {
|
enum list<T> {
|
||||||
nil;
|
nil;
|
||||||
cons(T, @list<T>);
|
cons(T, @list<T>);
|
||||||
}
|
}
|
||||||
|
|
||||||
let a: list<int> = cons(7, @cons(13, @nil));
|
let a: list<int> = cons(7, @cons(13, @nil));
|
||||||
|
|
||||||
**Matlab**
|
**Matlab**
|
||||||
|
|
||||||
@ -1932,7 +1932,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
for i = 1: n-1
|
for i = 1: n-1
|
||||||
len(i) = points(i + 1, 1) - points(i, 1);
|
len(i) = points(i + 1, 1) - points(i, 1);
|
||||||
end
|
end
|
||||||
while(max(len) > 2 * min(len))
|
while(max(len) > 2 * min(len))
|
||||||
[d, i] = max(len);
|
[d, i] = max(len);
|
||||||
k = on_margin(points, i, d, -1);
|
k = on_margin(points, i, d, -1);
|
||||||
m = on_margin(points, i + 1, d, 1);
|
m = on_margin(points, i + 1, d, 1);
|
||||||
@ -1966,7 +1966,7 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
library(ggplot2)
|
library(ggplot2)
|
||||||
|
|
||||||
centre <- function(x, type, ...) {
|
centre <- function(x, type, ...) {
|
||||||
switch(type,
|
switch(type,
|
||||||
mean = mean(x),
|
mean = mean(x),
|
||||||
median = median(x),
|
median = median(x),
|
||||||
@ -1995,8 +1995,8 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
1L + 30
|
1L + 30
|
||||||
plot(cars, xlim=20)
|
plot(cars, xlim=20)
|
||||||
plot(cars, xlim=0x20)
|
plot(cars, xlim=0x20)
|
||||||
foo<-30
|
foo<-30
|
||||||
my.data.3 <- read() # not a number
|
my.data.3 <- read() # not a number
|
||||||
c(1,2,3)
|
c(1,2,3)
|
||||||
1%%2
|
1%%2
|
||||||
|
|
||||||
@ -2025,8 +2025,8 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
For If In Else Next Break .. .... "NULL" `NULL` 'NULL'
|
For If In Else Next Break .. .... "NULL" `NULL` 'NULL'
|
||||||
|
|
||||||
# operators
|
# operators
|
||||||
+, -, *, /, %%, ^, >, >=, <, <=, ==, !=, !, &, |, ~,
|
+, -, *, /, %%, ^, >, >=, <, <=, ==, !=, !, &, |, ~,
|
||||||
->, <-, <<-, $, :, ::
|
->, <-, <<-, $, :, ::
|
||||||
|
|
||||||
# infix operator
|
# infix operator
|
||||||
foo %union% bar
|
foo %union% bar
|
||||||
@ -2056,17 +2056,17 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
let D;
|
let D;
|
||||||
|
|
||||||
attr D is LambdaTerm-like means
|
attr D is LambdaTerm-like means
|
||||||
(dom D qua Tree) is finite &
|
(dom D qua Tree) is finite &
|
||||||
::> *143,306
|
::> *143,306
|
||||||
for r st r in dom D holds
|
for r st r in dom D holds
|
||||||
r is FinSequence of {0,1} &
|
r is FinSequence of {0,1} &
|
||||||
r^<*0*> in dom D implies D.r = 0;
|
r^<*0*> in dom D implies D.r = 0;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
registration
|
registration
|
||||||
cluster LambdaTerm-like for DecoratedTree of NAT;
|
cluster LambdaTerm-like for DecoratedTree of NAT;
|
||||||
existence;
|
existence;
|
||||||
::> *4
|
::> *4
|
||||||
end;
|
end;
|
||||||
|
|
||||||
definition
|
definition
|
||||||
@ -2080,22 +2080,22 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
|
|
||||||
pred M beta N means
|
pred M beta N means
|
||||||
ex p st
|
ex p st
|
||||||
M|p beta_shallow N|p &
|
M|p beta_shallow N|p &
|
||||||
for q st not p is_a_prefix_of q holds
|
for q st not p is_a_prefix_of q holds
|
||||||
[r,x] in M iff [r,x] in N;
|
[r,x] in M iff [r,x] in N;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
theorem Th4:
|
theorem Th4:
|
||||||
ProperPrefixes (v^<*x*>) = ProperPrefixes v \/ {v}
|
ProperPrefixes (v^<*x*>) = ProperPrefixes v \/ {v}
|
||||||
proof
|
proof
|
||||||
thus ProperPrefixes (v^<*x*>) c= ProperPrefixes v \/ {v}
|
thus ProperPrefixes (v^<*x*>) c= ProperPrefixes v \/ {v}
|
||||||
proof
|
proof
|
||||||
let y;
|
let y;
|
||||||
assume y in ProperPrefixes (v^<*x*>);
|
assume y in ProperPrefixes (v^<*x*>);
|
||||||
then consider v1 such that
|
then consider v1 such that
|
||||||
A1: y = v1 and
|
A1: y = v1 and
|
||||||
A2: v1 is_a_proper_prefix_of v^<*x*> by TREES_1:def 2;
|
A2: v1 is_a_proper_prefix_of v^<*x*> by TREES_1:def 2;
|
||||||
v1 is_a_prefix_of v & v1 <> v or v1 = v by A2,TREES_1:9;
|
v1 is_a_prefix_of v & v1 <> v or v1 = v by A2,TREES_1:9;
|
||||||
then
|
then
|
||||||
v1 is_a_proper_prefix_of v or v1 in {v} by TARSKI:def 1,XBOOLE_0:def 8;
|
v1 is_a_proper_prefix_of v or v1 in {v} by TARSKI:def 1,XBOOLE_0:def 8;
|
||||||
then y in ProperPrefixes v or y in {v} by A1,TREES_1:def 2;
|
then y in ProperPrefixes v or y in {v} by A1,TREES_1:def 2;
|
||||||
@ -2109,15 +2109,15 @@ Highlight.js highlights syntax in code examples on blogs, forums and in fact on
|
|||||||
then consider v1 such that
|
then consider v1 such that
|
||||||
A5: y = v1 and
|
A5: y = v1 and
|
||||||
A6: v1 is_a_proper_prefix_of v by TREES_1:def 2;
|
A6: v1 is_a_proper_prefix_of v by TREES_1:def 2;
|
||||||
v is_a_prefix_of v^<*x*> by TREES_1:1;
|
v is_a_prefix_of v^<*x*> by TREES_1:1;
|
||||||
then v1 is_a_proper_prefix_of v^<*x*> by A6,XBOOLE_1:58;
|
then v1 is_a_proper_prefix_of v^<*x*> by A6,XBOOLE_1:58;
|
||||||
hence thesis by A5,TREES_1:def 2;
|
hence thesis by A5,TREES_1:def 2;
|
||||||
end;
|
end;
|
||||||
v^{} = v by FINSEQ_1:34;
|
v^{} = v by FINSEQ_1:34;
|
||||||
then
|
then
|
||||||
v is_a_prefix_of v^<*x*> & v <> v^<*x*> by FINSEQ_1:33,TREES_1:1;
|
v is_a_prefix_of v^<*x*> & v <> v^<*x*> by FINSEQ_1:33,TREES_1:1;
|
||||||
then v is_a_proper_prefix_of v^<*x*> by XBOOLE_0:def 8;
|
then v is_a_proper_prefix_of v^<*x*> by XBOOLE_0:def 8;
|
||||||
then y in ProperPrefixes v or y = v & v in ProperPrefixes (v^<*x*>)
|
then y in ProperPrefixes v or y = v & v in ProperPrefixes (v^<*x*>)
|
||||||
by A3,TARSKI:def 1,TREES_1:def 2;
|
by A3,TARSKI:def 1,TREES_1:def 2;
|
||||||
hence thesis by A4;
|
hence thesis by A4;
|
||||||
end;
|
end;
|
||||||
@ -2132,7 +2132,7 @@ Explicit Python highlighting
|
|||||||
count(x)
|
count(x)
|
||||||
|
|
||||||
|
|
||||||
Language set on <pre>
|
Language set on <pre>
|
||||||
|
|
||||||
for x in [1, 2, 3]:
|
for x in [1, 2, 3]:
|
||||||
count(x)
|
count(x)
|
||||||
@ -2149,9 +2149,9 @@ Replacing TAB with 4 spaces
|
|||||||
|
|
||||||
Custom markup
|
Custom markup
|
||||||
|
|
||||||
<<a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</a> id="contents">
|
<<a href="http://dev.w3.org/html5/spec/Overview.html#the-div-element">div</a> id="contents">
|
||||||
<del><p>Hello, World!</del><!-- A comment should not break merging --><ins>Goodbye, cruel world!</ins>
|
<del><p>Hello, World!</del><!-- A comment should not break merging --><ins>Goodbye, cruel world!</ins>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
Custom markup + TAB replacement
|
Custom markup + TAB replacement
|
||||||
|
|
||||||
|
2
js/highlight.min.js
vendored
2
js/highlight.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user