-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bfb3674
commit 4d31e22
Showing
12 changed files
with
184 additions
and
2 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Prism.languages.birb = Prism.languages.extend('clike', { | ||
'class-name': [ | ||
/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/, | ||
|
||
// matches variable and function return types (parameters as well). | ||
/\b[A-Z]\w*(?=\s+\w+\s*[;,=()])/ | ||
], | ||
'string': { | ||
pattern: /r?("|')(?:\\.|(?!\1)[^\\])*\1/, | ||
greedy: true | ||
}, | ||
'keyword': /\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|next|new|noSeeb|return|static|switch|throw|var|void|while)\b/, | ||
'variable': /\b[a-z_]\w*\b/, | ||
'operator': /\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/, | ||
}); | ||
|
||
Prism.languages.insertBefore('birb','function',{ | ||
'metadata': { | ||
pattern: /<\w+>/, | ||
greedy: true, | ||
alias: 'symbol' | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<h2>Comments</h2> | ||
<pre><code>// Single line comment | ||
/* Block comment | ||
on multiple lines */</code></pre> | ||
|
||
<h2>Annotations</h2> | ||
<pre><code><Supersede> // marks an instance member as overriding a superclass</code></pre> | ||
|
||
<h2>Numbers</h2> | ||
<pre><code>int x = 1; | ||
double y = 1.1; | ||
</code></pre> | ||
|
||
<h2>Strings</h2> | ||
<pre><code>String s1 = 'Strings allow single quotes'; | ||
String s2 = "as well as double quotes"; | ||
var s2 = 'Birb strings are | ||
multiline by default';</code></pre> | ||
|
||
<h2>Full example</h2> | ||
<pre><code>class Birb { | ||
final String name; | ||
int age = 19; | ||
|
||
void construct(String newName){ | ||
nest.name = newName; | ||
} | ||
} | ||
Birb.construct('Yoko'); | ||
screm(Birb.name); | ||
</code></pre> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
"markup", | ||
"csharp" | ||
], | ||
"birb": "clike", | ||
"bison": "c", | ||
"c": "clike", | ||
"csharp": "clike", | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
void foo(int a) {} | ||
foo(0); | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "void"], | ||
["function", "foo"], | ||
["punctuation", "("], | ||
["variable", "int"], | ||
["variable", "a"], | ||
["punctuation", ")"], | ||
["punctuation", "{"], | ||
["punctuation", "}"], | ||
|
||
["function", "foo"], | ||
["punctuation", "("], | ||
["number", "0"], | ||
["punctuation", ")"], | ||
["punctuation", ";"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for functions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
assert break case | ||
class; | ||
const default | ||
else enum | ||
final | ||
follows; | ||
for grab | ||
if nest | ||
next; | ||
new; | ||
noSeeb return | ||
static switch | ||
throw var | ||
void while | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["keyword", "assert"], ["keyword", "break"], ["keyword", "case"], | ||
["keyword", "class"], ["punctuation", ";"], | ||
["keyword", "const"], ["keyword", "default"], | ||
["keyword", "else"], ["keyword", "enum"], | ||
["keyword", "final"], | ||
["keyword", "follows"], ["punctuation", ";"], | ||
["keyword", "for"], ["keyword", "grab"], | ||
["keyword", "if"], ["keyword", "nest"], | ||
["keyword", "next"], ["punctuation", ";"], | ||
["keyword", "new"], ["punctuation", ";"], | ||
["keyword", "noSeeb"], ["keyword", "return"], | ||
["keyword", "static"], ["keyword", "switch"], | ||
["keyword", "throw"], ["keyword", "var"], | ||
["keyword", "void"], ["keyword", "while"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for all keywords. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Supersede> | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["metadata", "<Supersede>"] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for metadata. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
++ -- | ||
* / % ~/ | ||
+ - ! ~ | ||
<< >> ? : | ||
& ^ | | ||
>= > <= < | ||
== != && || | ||
= *= /= | ||
%= += -= | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["operator", "++"], ["operator", "--"], | ||
["operator", "*"], ["operator", "/"], ["operator", "%"], ["operator", "~/"], | ||
["operator", "+"], ["operator", "-"], ["operator", "!"], ["operator", "~"], | ||
["operator", "<<"], ["operator", ">>"], ["operator", "?"], ["operator", ":"], | ||
["operator", "&"], ["operator", "^"], ["operator", "|"], | ||
["operator", ">="], ["operator", ">"], ["operator", "<="], ["operator", "<"], | ||
["operator", "=="], ["operator", "!="], ["operator", "&&"], ["operator", "||"], | ||
["operator", "="], ["operator", "*="], ["operator", "/="], | ||
["operator", "%="], ["operator", "+="], ["operator", "-="] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for all operators. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"" '' | ||
r"" r'' | ||
"fo\"o" 'fo\'o' | ||
'foo | ||
bar' | ||
"foo | ||
bar" | ||
|
||
---------------------------------------------------- | ||
|
||
[ | ||
["string", "\"\""], ["string", "''"], | ||
["string", "r\"\""], ["string", "r''"], | ||
["string", "\"fo\\\"o\""], ["string", "'fo\\'o'"], | ||
["string", "'foo\r\nbar'"], | ||
["string", "\"foo\r\nbar\""] | ||
] | ||
|
||
---------------------------------------------------- | ||
|
||
Checks for single quoted, double quoted, and multiline strings |