generated from mateusfg7/nextjs-setup
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(rehype-pretty-code): add new langauges: "VisuAlg" and "Birl"
- Loading branch information
Showing
4 changed files
with
237 additions
and
2 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
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,60 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "BIRL", | ||
"scopeName": "source.birl", | ||
"patterns": [ | ||
{ "include": "#keywords" }, | ||
{ "include": "#functions" }, | ||
{ "include": "#constants" }, | ||
{ "include": "#numbers" }, | ||
{ "include": "#logical" }, | ||
{ "include": "#types" }, | ||
{ "include": "#comments" }, | ||
{ "include": "#arithmetic" }, | ||
{ "include": "#assignments" }, | ||
{ "include": "#comparison" }, | ||
{ "include": "#strings" }, | ||
{ "include": "#storages" }, | ||
{ "include": "#identifiers" } | ||
], | ||
"repository": { | ||
"keywords": { | ||
"patterns": [{ | ||
"name": "keyword.control.birl", | ||
"match": "\\b(HORA DO SHOW|ELE QUE A GENTE QUER?|NAO VAI DAR NAO|QUE NAO VAI DAR O QUE?|VAMO MONSTRO|SAI FILHO DA PUTA|MAIS QUERO MAIS|AJUDA O MALUCO TA DOENTE|NEGATIVA BAMBAM|BORA CUMPADE|BIRL|OH O HOME AI PO|CE QUER VER ESSA PORRA?|FRANGO|MONSTRINHO|MONSTRO|MONSTRAO|TRAPEZIO|TRAPEZIO DESCENDENTE|BICEPS)\\b" | ||
}] | ||
} | ||
}, | ||
"identifiers": { | ||
"patterns": [ | ||
{ | ||
"name": "entity.other.attribute-name", | ||
"match": "(\\b(super)\\b)|#[_a-zA-Z0-9]+" | ||
}, | ||
{ | ||
"name": "entity.name.function", | ||
"match": "((?<=classe\\s)|(?<=herda\\s))([_a-zA-Z0-9]+)" | ||
}, | ||
{ | ||
"name": "entity.name.function", | ||
"match": "([_a-zA-Z0-9]+)(?=[ ]*[=][ ]*(\\(|funcao))" | ||
}, | ||
{ | ||
"name": "variable.parameter", | ||
"match": "([_a-zA-Z0-9]+)(?=[ ]*[=])" | ||
}, | ||
{ | ||
"name": "entity.other.attribute-name", | ||
"match": "([_a-zA-Z0-9]+)(?=[ ]*[:])" | ||
}, | ||
{ | ||
"name": "entity.name.function", | ||
"match": "([_a-zA-Z0-9]+)(?=([\\s]*\\())" | ||
}, | ||
{ | ||
"name": "variable.language", | ||
"match": "[_a-zA-Z0-9]+" | ||
} | ||
] | ||
} | ||
} |
110 changes: 110 additions & 0 deletions
110
content/plugin/rehype-pretty-code/visualg.tmLanguage.json
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,110 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", | ||
"name": "VisuAlg", | ||
"scopeName": "source.visualg", | ||
"patterns": [ | ||
{ "include": "#keywords" }, | ||
{ "include": "#functions" }, | ||
{ "include": "#constants" }, | ||
{ "include": "#numbers" }, | ||
{ "include": "#logical" }, | ||
{ "include": "#types" }, | ||
{ "include": "#comments" }, | ||
{ "include": "#arithmetic" }, | ||
{ "include": "#assignments" }, | ||
{ "include": "#comparison" }, | ||
{ "include": "#strings" }, | ||
{ "include": "#storages" }, | ||
{ "include": "#identifiers" } | ||
], | ||
"repository": { | ||
"keywords": { | ||
"patterns": [ | ||
{ | ||
"name": "keyword.control.visualg", | ||
"match": "(?i)\\b(ate|até|algoritmo|faca|faça|var|inicio|fimalgoritmo|se|senao|senão|fimse|para|fimpara|fazer|enquanto|escolha|caso|padrao|repita|tente|pegue|procedimento|fimprocedimento|finalmente|retorne|funcao|fimfuncao|função|fimfunção|escreva|leia)\\b" | ||
} | ||
] | ||
}, | ||
"comments": { | ||
"patterns": [ | ||
{ | ||
"match": "(//).*", | ||
"name": "comment.line.double-slash" | ||
} | ||
] | ||
}, | ||
"constants": { | ||
"patterns": [ | ||
{ | ||
"name": "constant.language.visualg", | ||
"match": "(?i)\\b(falso|verdadeiro)\\b" | ||
} | ||
] | ||
}, | ||
"functions": { | ||
"patterns": [{ | ||
"name": "keyword.function.visualg", | ||
"match": "\\b(escreva|escreval|leia)\\b" | ||
}] | ||
}, | ||
"identifiers": { | ||
"patterns": [ | ||
{ | ||
"name": "entity.other.attribute-name", | ||
"match": "(\\b(super)\\b)|#[_a-zA-Z0-9]+" | ||
}, | ||
{ | ||
"name": "entity.name.function", | ||
"match": "((?<=classe\\s)|(?<=herda\\s))([_a-zA-Z0-9]+)" | ||
}, | ||
{ | ||
"name": "entity.name.function", | ||
"match": "([_a-zA-Z0-9]+)(?=[ ]*[=][ ]*(\\(|funcao))" | ||
}, | ||
{ | ||
"name": "variable.parameter", | ||
"match": "([_a-zA-Z0-9]+)(?=[ ]*[=])" | ||
}, | ||
{ | ||
"name": "entity.other.attribute-name", | ||
"match": "([_a-zA-Z0-9]+)(?=[ ]*[:])" | ||
}, | ||
{ | ||
"name": "entity.name.function", | ||
"match": "([_a-zA-Z0-9]+)(?=([\\s]*\\())" | ||
}, | ||
{ | ||
"name": "variable.language", | ||
"match": "[_a-zA-Z0-9]+" | ||
} | ||
] | ||
}, | ||
"strings": { | ||
"patterns": [ | ||
{ | ||
"name": "string.quoted.single.visualg", | ||
"begin": "\\'", | ||
"end": "\\'", | ||
"patterns": [ | ||
{ | ||
"name": "constant.character.escape.visualg", | ||
"match": "\\\\." | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "string.quoted.double.visualg", | ||
"begin": "\"", | ||
"end": "\"", | ||
"patterns": [ | ||
{ | ||
"name": "constant.character.escape.visualg", | ||
"match": "\\\\." | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
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 |
---|---|---|
|
@@ -200,6 +200,46 @@ const sum: (x: number) => number = foo | |
const y: number = sum(1) | ||
``` | ||
|
||
Portugol VisualG (show line numbers) {/* https://github.com/DesignLiquido/delegua */} | ||
|
||
```visualg showLineNumbers | ||
algoritimo "Idade" | ||
// Disciplina : Programação Estruturada | ||
// Professor : Adjenor Cristiano | ||
// Descrição : Determina se o usuário é maior de idade ou não | ||
// Autor(a) : Mateus Felipe Gonçalves <[email protected]> | ||
// Data atual : 23/02/2024 | ||
var | ||
idade: inteiro | ||
inicio | ||
escreval("Sua idade") | ||
escreva("-> ") | ||
leia(idade) | ||
escreval("") | ||
se (idade >= 18) entao | ||
escreva("Maior de idade") | ||
senao | ||
escreva("Menor de idade") | ||
fimse | ||
escreval("") | ||
fimalgoritimo | ||
``` | ||
|
||
Birl {/* https://github.com/DesignLiquido/delegua */} | ||
|
||
```birl | ||
HORA DO SHOW | ||
FRANGO FR = 'a'; | ||
CE QUER VER ESSA PORRA? ("Hello, World! Porra!\n"); | ||
BORA CUMPADE 0; | ||
BIRL | ||
``` | ||
|
||
Rust | ||
|
||
```rust title="Simple Rust code with title" | ||
|