-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
2 changed files
with
140 additions
and
0 deletions.
There are no files selected for viewing
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,53 @@ | ||
{ | ||
"name": "Aleo Color Scheme", | ||
"globals": | ||
{ | ||
"background": "rgb(34, 34, 34)", | ||
"foreground": "#EEEEEE", | ||
"caret": "white" | ||
}, | ||
"rules": | ||
[ | ||
{ | ||
"name": "Keyword", | ||
"scope": "keyword", | ||
"foreground": "#F92672", | ||
}, | ||
{ | ||
"name": "Finalize", | ||
"scope": "finalize", | ||
"foreground": "#AE81FF", | ||
}, | ||
{ | ||
"name": "Qualifiers", | ||
"scope": "qualifiers", | ||
"foreground": "#FD971F", | ||
}, | ||
{ | ||
"name": "Visibility", | ||
"scope": "visibility", | ||
"foreground": "#66D9EF", | ||
}, | ||
{ | ||
"name": "Instruction", | ||
"scope": "instruction", | ||
"foreground": "#A6E22E", | ||
}, | ||
{ | ||
"name": "Comment", | ||
"scope": "comment", | ||
"foreground": "#888888" | ||
}, | ||
{ | ||
"name": "String", | ||
"scope": "string", | ||
"foreground": "#E6DB74", | ||
}, | ||
{ | ||
"name": "Number", | ||
"scope": "constant.numeric", | ||
"foreground": "#AE81FF", | ||
"font_style": "italic", | ||
} | ||
] | ||
} |
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,87 @@ | ||
%YAML 1.2 | ||
--- | ||
# See https://www.sublimetext.com/docs/syntax.html | ||
name: Aleo | ||
file_extensions: | ||
- aleo | ||
scope: source.aleo # Namespace for a language context. The scope should be unique for each context. | ||
# scopeName: aleo.log | ||
|
||
contexts: | ||
# The prototype context is prepended to all contexts but those setting | ||
# meta_include_prototype: false. | ||
prototype: | ||
- include: comments | ||
|
||
main: | ||
# The main context is the initial starting point of our syntax. | ||
# Include other contexts from here (or specify them directly). | ||
- include: keywords | ||
- include: finalize | ||
- include: qualifiers | ||
- include: visibility | ||
- include: instructions | ||
- include: numbers | ||
- include: strings | ||
|
||
keywords: | ||
# Keywords are the following. | ||
# Note that blackslashes don't need to be escaped within single quoted | ||
# strings in YAML. When using single quoted strings, only single quotes | ||
# need to be escaped: this is done by using two single quotes next to each | ||
# other. | ||
- match: '\b(function|program|as|by|interface|closure|into|import)\b' | ||
scope: keyword.control.aleo | ||
|
||
finalize: | ||
- match: '\b(finalize|mapping|increment|decrement)\b' | ||
scope: finalize.aleo | ||
|
||
qualifiers: | ||
- match: '\b()\b' | ||
scope: qualifiers.aleo | ||
|
||
visibility: | ||
- match: '\b(constant|public|private|record|aleo)\b' | ||
scope: visibility.aleo | ||
|
||
instructions: | ||
- match: '\b(abs\.w|abs|add\.w|add|and|assert\.eq|assert\.neq|call|cast|commit\.bhp256|commit\.bhp512|commit\.bhp768|commit\.bhp1024|commit\.ped64|commit\.ped128|div\.w|div|double|gt|gte|hash\.bhp256|hash\.bhp512|hash\.bhp768|hash\.bhp1024|hash\.ped64|hash\.ped128|hash\.psd2|hash\.psd4|hash\.psd8|inv|input|is\.eq|is\.neq|lt|lte|key|mod|mul\.w|mul|nand|neg|nor|not|or|output|pow\.w|pow|rem\.w|rem|shl\.w|shl|shr\.w|srh|sqrt|sub\.w|sub|square|ternary|value|xor)\b' | ||
scope: instruction.aleo | ||
|
||
numbers: | ||
- match: '\b(-)?[0-9.]+\b' | ||
scope: constant.numeric.aleo | ||
|
||
strings: | ||
# Strings begin and end with quotes, and use backslashes as an escape | ||
# character. | ||
- match: '"' | ||
scope: punctuation.definition.string.begin.aleo | ||
push: inside_string | ||
|
||
inside_string: | ||
- meta_include_prototype: false | ||
- meta_scope: string.quoted.double.aleo | ||
- match: '\.' | ||
scope: constant.character.escape.aleo | ||
- match: '"' | ||
scope: punctuation.definition.string.end.aleo | ||
pop: true | ||
|
||
comments: | ||
# Comments begin with a '//' and finish at the end of the line. | ||
- match: '//' | ||
scope: punctuation.definition.comment.aleo | ||
push: | ||
# This is an anonymous context push for brevity. | ||
- meta_scope: comment.line.double-slash.aleo | ||
- match: $\n? | ||
pop: true | ||
# Multi-line comments begin with a '/*' and finish with a '*/'. | ||
- match: '/\*' | ||
scope: punctuation.definition.comment.c | ||
push: | ||
- meta_scope: comment.block.c | ||
- match: '\*/' | ||
pop: true |