🐐 Update code snippets
6
snippets/alvid.cent
Normal file
@@ -0,0 +1,6 @@
|
||||
DESIGNA x VT VERITAS
|
||||
SI x TVNC {
|
||||
DICE(I)
|
||||
} ALVID {
|
||||
DICE(NVLLVS)
|
||||
}
|
||||
BIN
snippets/alvid.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
8
snippets/alvid_si.cent
Normal file
@@ -0,0 +1,8 @@
|
||||
DESIGNA x VT II
|
||||
SI x EST I TVNC {
|
||||
DICE(I)
|
||||
} ALVID SI x EST II TVNC {
|
||||
DICE(II)
|
||||
} ALVID {
|
||||
DICE(III)
|
||||
}
|
||||
BIN
snippets/alvid_si.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
2
snippets/array_index.cent
Normal file
@@ -0,0 +1,2 @@
|
||||
DESIGNA x VT [I, II, III]
|
||||
DICE(x[I])
|
||||
BIN
snippets/array_index.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
1
snippets/array_literal.cent
Normal file
@@ -0,0 +1 @@
|
||||
DESIGNA x VT [I, II, III]
|
||||
BIN
snippets/array_literal.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
1
snippets/array_vsqve.cent
Normal file
@@ -0,0 +1 @@
|
||||
DESIGNA x VT [I VSQVE X]
|
||||
BIN
snippets/array_vsqve.png
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
9
snippets/boolean_ops.cent
Normal file
@@ -0,0 +1,9 @@
|
||||
DESIGNA x VT VERITAS
|
||||
DESIGNA y VT FALSITAS
|
||||
SI x ET y TVNC {
|
||||
DICE(I)
|
||||
} ALVID SI x AVT y TVNC {
|
||||
DICE(II)
|
||||
} ALVID {
|
||||
DICE(III)
|
||||
}
|
||||
BIN
snippets/boolean_ops.png
Normal file
|
After Width: | Height: | Size: 34 KiB |
2
snippets/dice.cent
Normal file
@@ -0,0 +1,2 @@
|
||||
DICE("Hello, world!")
|
||||
DICE(I, II, III)
|
||||
BIN
snippets/dice.png
Normal file
|
After Width: | Height: | Size: 9.3 KiB |
5
snippets/donicvm.cent
Normal file
@@ -0,0 +1,5 @@
|
||||
DESIGNA x VT NVLLVS
|
||||
DONICVM y VT NVLLVS VSQVE X FACE {
|
||||
DESIGNA x VT x + y
|
||||
}
|
||||
DICE(x)
|
||||
BIN
snippets/donicvm.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
5
snippets/dvm.cent
Normal file
@@ -0,0 +1,5 @@
|
||||
DESIGNA x VT NVLLVS
|
||||
DVM x PLVS X FACE {
|
||||
DESIGNA x VT x+I
|
||||
}
|
||||
DICE(x)
|
||||
BIN
snippets/dvm.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
9
snippets/fibonacci.cent
Normal file
@@ -0,0 +1,9 @@
|
||||
DEFINI fib(x) VT {
|
||||
SI x EST NVLLVS TVNC {
|
||||
REDI(NVLLVS)
|
||||
} ALVID SI x EST I TVNC {
|
||||
REDI(I)
|
||||
} ALVID {
|
||||
REDI(INVOCA fib(x-II) + INVOCA fib(x-I))
|
||||
}
|
||||
}
|
||||
BIN
snippets/fibonacci.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
1
snippets/fors.cent
Normal file
@@ -0,0 +1 @@
|
||||
CVM FORS
|
||||
BIN
snippets/fors.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
1
snippets/fractio.cent
Normal file
@@ -0,0 +1 @@
|
||||
CVM FRACTIO
|
||||
BIN
snippets/fractio.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
5
snippets/function.cent
Normal file
@@ -0,0 +1,5 @@
|
||||
DEFINI sqvare(x) VT {
|
||||
REDI(x*x)
|
||||
}
|
||||
|
||||
DICE(INVOCA sqvare(XI))
|
||||
BIN
snippets/function.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
17
snippets/guessing.cent
Normal file
@@ -0,0 +1,17 @@
|
||||
CVM FORS
|
||||
|
||||
DESIGNA correct VT FORTIS_NVMERVS(I,C)
|
||||
DESIGNA gvess VT NVLLVS
|
||||
|
||||
DVM FALSITAS FACE {
|
||||
DESIGNA gvess VT AVDI_NVMERVS()
|
||||
SI gvess MINVS correct TVNC {
|
||||
DICE("Too low!")
|
||||
} ALVID SI gvess PLVS correct TVNC {
|
||||
DICE("Too high!")
|
||||
} ALVID {
|
||||
ERVMPE
|
||||
}
|
||||
}
|
||||
|
||||
DICE("You guessed correctly!")
|
||||
BIN
snippets/guessing.png
Normal file
|
After Width: | Height: | Size: 83 KiB |
2
snippets/hello_world.cent
Normal file
@@ -0,0 +1,2 @@
|
||||
DESIGNA x VT "Hello World!"
|
||||
DICE(x)
|
||||
BIN
snippets/hello_world.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
1
snippets/magnvm.cent
Normal file
@@ -0,0 +1 @@
|
||||
CVM MAGNVM
|
||||
BIN
snippets/magnvm.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
1
snippets/module_decl.cent
Normal file
@@ -0,0 +1 @@
|
||||
CVM MODVLE_NOMEN
|
||||
BIN
snippets/module_decl.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
4
snippets/per.cent
Normal file
@@ -0,0 +1,4 @@
|
||||
DESIGNA x VT [I, II, III, IV, V]
|
||||
PER y IN x FACE {
|
||||
DICE(y)
|
||||
}
|
||||
BIN
snippets/per.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
7
snippets/si_tvnc.cent
Normal file
@@ -0,0 +1,7 @@
|
||||
DESIGNA x VT VERITAS
|
||||
SI x TVNC {
|
||||
DICE(I)
|
||||
REDI(NVLLVS)
|
||||
}
|
||||
|
||||
DICE(NVLLVS)
|
||||
BIN
snippets/si_tvnc.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
1
snippets/string_concat.cent
Normal file
@@ -0,0 +1 @@
|
||||
DESIGNA greeting VT "Hello, " & "world!"
|
||||
BIN
snippets/string_concat.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
1
snippets/string_literal.cent
Normal file
@@ -0,0 +1 @@
|
||||
DESIGNA x VT "this is a string"
|
||||
BIN
snippets/string_literal.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
1
snippets/svbnvlla.cent
Normal file
@@ -0,0 +1 @@
|
||||
CVM SVBNVLLA
|
||||
BIN
snippets/svbnvlla.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
77
snippets/syntax/centvrion.sublime-syntax
Normal file
@@ -0,0 +1,77 @@
|
||||
%YAML 1.2
|
||||
---
|
||||
name: Centvrion
|
||||
file_extensions:
|
||||
- cent
|
||||
scope: source.centvrion
|
||||
|
||||
contexts:
|
||||
main:
|
||||
- include: comments
|
||||
- include: strings
|
||||
- include: fractions
|
||||
- include: numerals
|
||||
- include: constants
|
||||
- include: builtins
|
||||
- include: modules
|
||||
- include: keywords
|
||||
- include: operators
|
||||
- include: identifiers
|
||||
|
||||
comments:
|
||||
- match: '//[^\n]*'
|
||||
scope: comment.line.centvrion
|
||||
- match: '/\*'
|
||||
scope: comment.block.centvrion
|
||||
push:
|
||||
- meta_scope: comment.block.centvrion
|
||||
- match: '\*/'
|
||||
pop: true
|
||||
|
||||
strings:
|
||||
- match: '"'
|
||||
scope: string.quoted.double.centvrion
|
||||
push:
|
||||
- meta_scope: string.quoted.double.centvrion
|
||||
- match: '"'
|
||||
pop: true
|
||||
- match: "'"
|
||||
scope: string.quoted.single.centvrion
|
||||
push:
|
||||
- meta_scope: string.quoted.single.centvrion
|
||||
- match: "'"
|
||||
pop: true
|
||||
|
||||
fractions:
|
||||
- match: '\b[IVXLCDM][IVXLCDM_]*(?:S[S:.|]*|:[S:.|]+|\.[S:.|]*)'
|
||||
scope: constant.numeric.fraction.centvrion
|
||||
- match: '(?<![IVXLCDM_])(?:S[S:.|]+|:[S:.|]+)'
|
||||
scope: constant.numeric.fraction.centvrion
|
||||
|
||||
numerals:
|
||||
- match: '\b[IVXLCDM][IVXLCDM_]*\b'
|
||||
scope: constant.numeric.centvrion
|
||||
|
||||
constants:
|
||||
- match: '\b(VERITAS|FALSITAS|NVLLVS)\b'
|
||||
scope: constant.language.centvrion
|
||||
|
||||
builtins:
|
||||
- match: '\b(AVDI_NVMERVS|AVDI|DICE|FORTIS_NVMERVS|FORTIS_ELECTIONIS|LONGITVDO)\b'
|
||||
scope: support.function.builtin.centvrion
|
||||
|
||||
modules:
|
||||
- match: '\b(FORS|FRACTIO|MAGNVM|SVBNVLLA)\b'
|
||||
scope: support.class.module.centvrion
|
||||
|
||||
keywords:
|
||||
- match: '\b(ALVID|AVT|DEFINI|DESIGNA|DONICVM|DVM|ERVMPE|EST|ET|FACE|INVOCA|IN|MINVS|NON|PER|PLVS|REDI|SI|TVNC|VSQVE|VT|CVM)\b'
|
||||
scope: keyword.control.centvrion
|
||||
|
||||
operators:
|
||||
- match: '[+\-*/&]'
|
||||
scope: keyword.operator.centvrion
|
||||
|
||||
identifiers:
|
||||
- match: '[abcdefghiklmnopqrstvxyz_]+'
|
||||
scope: variable.other.centvrion
|
||||
77
snippets/syntaxes/centvrion.sublime-syntax
Normal file
@@ -0,0 +1,77 @@
|
||||
%YAML 1.2
|
||||
---
|
||||
name: Centvrion
|
||||
file_extensions:
|
||||
- cent
|
||||
scope: source.centvrion
|
||||
|
||||
contexts:
|
||||
main:
|
||||
- include: comments
|
||||
- include: strings
|
||||
- include: fractions
|
||||
- include: numerals
|
||||
- include: constants
|
||||
- include: builtins
|
||||
- include: modules
|
||||
- include: keywords
|
||||
- include: operators
|
||||
- include: identifiers
|
||||
|
||||
comments:
|
||||
- match: '//[^\n]*'
|
||||
scope: comment.line.centvrion
|
||||
- match: '/\*'
|
||||
scope: comment.block.centvrion
|
||||
push:
|
||||
- meta_scope: comment.block.centvrion
|
||||
- match: '\*/'
|
||||
pop: true
|
||||
|
||||
strings:
|
||||
- match: '"'
|
||||
scope: string.quoted.double.centvrion
|
||||
push:
|
||||
- meta_scope: string.quoted.double.centvrion
|
||||
- match: '"'
|
||||
pop: true
|
||||
- match: "'"
|
||||
scope: string.quoted.single.centvrion
|
||||
push:
|
||||
- meta_scope: string.quoted.single.centvrion
|
||||
- match: "'"
|
||||
pop: true
|
||||
|
||||
fractions:
|
||||
- match: '\b[IVXLCDM][IVXLCDM_]*(?:S[S:.|]*|:[S:.|]+|\.[S:.|]*)'
|
||||
scope: constant.numeric.fraction.centvrion
|
||||
- match: '(?<![IVXLCDM_])(?:S[S:.|]+|:[S:.|]+)'
|
||||
scope: constant.numeric.fraction.centvrion
|
||||
|
||||
numerals:
|
||||
- match: '\b[IVXLCDM][IVXLCDM_]*\b'
|
||||
scope: constant.numeric.centvrion
|
||||
|
||||
constants:
|
||||
- match: '\b(VERITAS|FALSITAS|NVLLVS)\b'
|
||||
scope: constant.language.centvrion
|
||||
|
||||
builtins:
|
||||
- match: '\b(AVDI_NVMERVS|AVDI|DICE|FORTIS_NVMERVS|FORTIS_ELECTIONIS|LONGITVDO)\b'
|
||||
scope: support.function.builtin.centvrion
|
||||
|
||||
modules:
|
||||
- match: '\b(FORS|FRACTIO|MAGNVM|SVBNVLLA)\b'
|
||||
scope: support.class.module.centvrion
|
||||
|
||||
keywords:
|
||||
- match: '\b(ALVID|AVT|DEFINI|DESIGNA|DONICVM|DVM|ERVMPE|EST|ET|FACE|INVOCA|IN|MINVS|NON|PER|PLVS|REDI|SI|TVNC|VSQVE|VT|CVM)\b'
|
||||
scope: keyword.control.centvrion
|
||||
|
||||
operators:
|
||||
- match: '[+\-*/&]'
|
||||
scope: keyword.operator.centvrion
|
||||
|
||||
identifiers:
|
||||
- match: '[abcdefghiklmnopqrstvxyz_]+'
|
||||
scope: variable.other.centvrion
|
||||
1
snippets/variable.cent
Normal file
@@ -0,0 +1 @@
|
||||
DESIGNA x VT XXVI
|
||||
BIN
snippets/variable.png
Normal file
|
After Width: | Height: | Size: 6.0 KiB |