fbp-language 1.1.6 → 1.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -23,7 +23,7 @@ Puis, dans le `package.json` de ton projet :
23
23
  "start": "fbp run lancer"
24
24
  },
25
25
  "dependencies": {
26
- "fbp-language": "^1.1.6"
26
+ "fbp-language": "^1.1.9"
27
27
  }
28
28
  }
29
29
  ```
@@ -55,6 +55,18 @@ lance()
55
55
 
56
56
  Les chemins déclarés dans `commandes.fbp` sont relatifs à la racine du projet.
57
57
 
58
+ ## Initialiser un projet et installer le support VS Code
59
+
60
+ Dans le dossier de ton projet, exécute :
61
+
62
+ ```bash
63
+ fbp -init
64
+ ```
65
+
66
+ La commande crée `commandes.fbp` et `scripts/main.fbp` sans écraser les fichiers existants. Elle installe également le support FBP fourni avec le package dans le dossier des extensions VS Code de l’utilisateur. Si tu utilises une instance distante ou un environnement sans dossier d’extensions accessible, l’installation peut nécessiter une configuration manuelle. Recharge ensuite VS Code. Pour l’icône FBP, sélectionne `FBP File Icons` dans **Préférences : Thème d’icônes de fichiers**.
67
+
68
+ Le support VS Code contient la reconnaissance des fichiers `.fbp`, la coloration syntaxique et le thème d’icônes. Il est livré dans le même dépôt et le même package npm ; aucune extension séparée à rechercher n’est nécessaire.
69
+
58
70
  ## Commandes CLI
59
71
 
60
72
  ```bash
@@ -62,6 +74,7 @@ fbp help
62
74
  fbp version
63
75
  fbp info
64
76
  fbp ping
77
+ fbp -init
65
78
  fbp run lancer
66
79
  fbp run-file scripts/main.fbp
67
80
  ```
@@ -115,6 +128,18 @@ Associe `lancer` à `scripts/main.fbp` dans `commandes.fbp`, puis exécute `npx
115
128
 
116
129
  FBP enregistre les commandes déclarées comme commandes slash globales de l'application Discord. Leur apparition peut prendre un peu de temps après le premier enregistrement. Les noms doivent contenir de 1 à 32 caractères parmi les lettres minuscules, chiffres, tirets et underscores.
117
130
 
131
+ ## Sélecteur de salon Discord (v1.1.8)
132
+
133
+ Une commande slash peut proposer un sélecteur de salon Discord. La valeur choisie est réutilisable dans la réponse avec `{{salon}}` :
134
+
135
+ ```fbp
136
+ discordConnexion()
137
+ discordCommande("configurer", "Salon sélectionné : {{salon}}")
138
+ discordOptionSalon("configurer", "salon", "Choisis un salon", true)
139
+ ```
140
+
141
+ Le dernier argument indique si l'option est obligatoire. La réponse affiche le nom du salon précédé de `#`. Cette option peut être ajoutée aux commandes texte ou aux commandes embed, comme les autres options slash.
142
+
118
143
  ## Limites actuelles
119
144
 
120
145
  FBP est encore un interpréteur de base. Les paramètres de fonction, les conditions, les boucles, les valeurs de retour et les expressions arithmétiques ne sont pas encore implémentés. La connexion Discord utilise un token stocké dans `.env`. Les commandes slash peuvent répondre avec un texte fixe ou un embed défini avec `discordCommandeEmbed(nom, titre, description, couleur)`. Ajoute des champs avec `discordChamp(nomCommande, nomChamp, valeur)`. Les valeurs des embeds sont actuellement fixes : la récupération dynamique des informations du serveur, les options, paramètres, permissions avancées et conditions ne sont pas encore implémentés.
@@ -200,3 +225,29 @@ discordChoixEntier("difficulte", "niveau", "Difficile", 3)
200
225
  - Déclare toujours l'option avant ses choix.
201
226
  - Une option peut avoir jusqu'à 25 choix. Les noms de choix sont limités à 100 caractères.
202
227
  - Les choix sont présentés par Discord sous forme de liste et la valeur choisie est récupérable comme les autres options.
228
+
229
+
230
+ ## Limites numériques des options (v1.1.7)
231
+
232
+ Les options slash de type nombre et entier peuvent imposer une valeur minimale et maximale. Déclare l'option d'abord, puis ses limites :
233
+
234
+ ```fbp
235
+ discordConnexion()
236
+ discordCommande("age", "Âge sélectionné : {{age}}")
237
+ discordOptionEntier("age", "age", "Choisis un âge", true)
238
+ discordOptionEntierLimites("age", "age", 13, 99)
239
+
240
+ discordCommande("note", "Note sélectionnée : {{note}}")
241
+ discordOptionNombre("note", "note", "Choisis une note", true)
242
+ discordOptionNombreLimites("note", "note", 0, 20)
243
+ ```
244
+
245
+ - `discordOptionEntierLimites(commande, option, minimum, maximum)` accepte uniquement des bornes entières.
246
+ - `discordOptionNombreLimites(commande, option, minimum, maximum)` accepte des bornes numériques, y compris décimales.
247
+ - Le minimum doit être inférieur ou égal au maximum.
248
+ - Les limites s'appliquent à l'interface Discord. Une option avec des choix prédéfinis ne peut pas recevoir de limites.
249
+
250
+
251
+ ## Support VS Code
252
+
253
+ Le dossier `vscode-extension/` contient le manifeste d’extension, la grammaire TextMate, la configuration de langage et le thème d’icônes FBP. La commande `fbp -init` copie ce support dans le dossier d’extensions de VS Code. Le logo du thème d’icônes se trouve dans `vscode-extension/assets/fbp-logo.svg`.
Binary file
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 128" role="img" aria-labelledby="title">
2
+ <title id="title">FBP — { B }</title>
3
+ <g fill="currentColor" font-family="Arial, Helvetica, sans-serif" font-size="88" font-weight="600" text-anchor="middle">
4
+ <text x="48" y="94">{</text>
5
+ <text x="128" y="94">B</text>
6
+ <text x="208" y="94">}</text>
7
+ </g>
8
+ </svg>
package/dist/cli.js CHANGED
@@ -5,10 +5,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  };
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  const node_fs_1 = __importDefault(require("node:fs"));
8
+ const node_os_1 = __importDefault(require("node:os"));
8
9
  const node_path_1 = __importDefault(require("node:path"));
9
10
  const compiler_1 = require("./compiler");
10
11
  const errors_1 = require("./errors");
11
- const VERSION = "1.1.6";
12
+ const VERSION = "1.1.9";
12
13
  function help() {
13
14
  console.log(`FBP — French Bot Programming
14
15
 
@@ -17,6 +18,8 @@ Utilisation :
17
18
  fbp version Affiche la version de FBP
18
19
  fbp info Affiche les informations du moteur
19
20
  fbp ping Vérifie que le CLI répond
21
+ fbp -init Prépare un projet FBP et le support VS Code
22
+ fbp init Alias de -init
20
23
  fbp run <commande> Exécute une commande de commandes.fbp
21
24
  fbp run-file <fichier> Exécute directement un fichier .fbp`);
22
25
  }
@@ -26,6 +29,59 @@ function ping() {
26
29
  console.log(`Node.js : ${process.version}`);
27
30
  console.log("Bot : aucune connexion externe n'est configurée par le CLI seul.");
28
31
  }
32
+ function initProject() {
33
+ const root = process.cwd();
34
+ const commandsPath = node_path_1.default.join(root, "commandes.fbp");
35
+ const mainDir = node_path_1.default.join(root, "scripts");
36
+ const mainPath = node_path_1.default.join(mainDir, "main.fbp");
37
+ node_fs_1.default.mkdirSync(mainDir, { recursive: true });
38
+ if (!node_fs_1.default.existsSync(commandsPath)) {
39
+ node_fs_1.default.writeFileSync(commandsPath, JSON.stringify({ lancer: "scripts/main.fbp" }, null, 2) + "\n", "utf8");
40
+ console.log("Créé : commandes.fbp");
41
+ }
42
+ else {
43
+ console.log("Conservé : commandes.fbp existe déjà.");
44
+ }
45
+ if (!node_fs_1.default.existsSync(mainPath)) {
46
+ node_fs_1.default.writeFileSync(mainPath, 'nom = "Mon projet"\n\nlance() {\n affiche("FBP fonctionne !")\n affiche("Projet :", nom)\n}\n\nlance()\n', "utf8");
47
+ console.log("Créé : scripts/main.fbp");
48
+ }
49
+ else {
50
+ console.log("Conservé : scripts/main.fbp existe déjà.");
51
+ }
52
+ installVscodeSupport();
53
+ console.log("\nProjet FBP initialisé. Lance « fbp run lancer » pour exécuter le programme.");
54
+ }
55
+ function installVscodeSupport() {
56
+ const bundledExtension = node_path_1.default.resolve(__dirname, "../vscode-extension");
57
+ const manifestPath = node_path_1.default.join(bundledExtension, "package.json");
58
+ if (!node_fs_1.default.existsSync(manifestPath)) {
59
+ console.log("Support VS Code non trouvé dans le package. La coloration et l'icône n'ont pas été installées.");
60
+ return;
61
+ }
62
+ const extensionRoot = process.env.VSCODE_AGENT_FOLDER
63
+ ? node_path_1.default.join(process.env.VSCODE_AGENT_FOLDER, "extensions")
64
+ : process.platform === "win32"
65
+ ? node_path_1.default.join(process.env.USERPROFILE || node_os_1.default.homedir(), ".vscode", "extensions")
66
+ : node_path_1.default.join(node_os_1.default.homedir(), ".vscode", "extensions");
67
+ const destination = node_path_1.default.join(extensionRoot, `gabyy1.fbp-language-${VERSION}`);
68
+ try {
69
+ node_fs_1.default.mkdirSync(extensionRoot, { recursive: true });
70
+ if (node_fs_1.default.existsSync(destination)) {
71
+ node_fs_1.default.rmSync(destination, { recursive: true, force: true });
72
+ }
73
+ node_fs_1.default.cpSync(bundledExtension, destination, { recursive: true });
74
+ console.log(`Support VS Code installé dans : ${destination}`);
75
+ console.log("Recharge la fenêtre VS Code pour activer la coloration FBP.");
76
+ console.log("Pour afficher l'icône personnalisée, sélectionne « FBP File Icons » dans le thème d'icônes de fichiers.");
77
+ }
78
+ catch (error) {
79
+ console.log("Installation automatique du support VS Code impossible.");
80
+ console.log("Vérifie les permissions du dossier des extensions VS Code.");
81
+ if (error instanceof Error)
82
+ console.log(error.message);
83
+ }
84
+ }
29
85
  function runCommand(name) {
30
86
  const configPath = node_path_1.default.resolve("commandes.fbp");
31
87
  if (!node_fs_1.default.existsSync(configPath)) {
@@ -71,6 +127,10 @@ function main() {
71
127
  case "ping":
72
128
  ping();
73
129
  break;
130
+ case "-init":
131
+ case "init":
132
+ initProject();
133
+ break;
74
134
  case "run":
75
135
  if (!args[0])
76
136
  throw new errors_1.FbpError("Indique le nom de la commande. Exemple : fbp run lancer");
package/dist/compiler.js CHANGED
@@ -231,6 +231,10 @@ class FbpCompiler {
231
231
  }),
232
232
  nombre: () => builder.addNumberOption(item => {
233
233
  item.setName(option.name).setDescription(option.description).setRequired(option.required);
234
+ if (option.minValue !== undefined)
235
+ item.setMinValue(option.minValue);
236
+ if (option.maxValue !== undefined)
237
+ item.setMaxValue(option.maxValue);
234
238
  for (const choice of option.choices ?? [])
235
239
  if (typeof choice.value === "number")
236
240
  item.addChoices({ name: choice.name, value: choice.value });
@@ -238,12 +242,17 @@ class FbpCompiler {
238
242
  }),
239
243
  entier: () => builder.addIntegerOption(item => {
240
244
  item.setName(option.name).setDescription(option.description).setRequired(option.required);
245
+ if (option.minValue !== undefined)
246
+ item.setMinValue(option.minValue);
247
+ if (option.maxValue !== undefined)
248
+ item.setMaxValue(option.maxValue);
241
249
  for (const choice of option.choices ?? [])
242
250
  if (typeof choice.value === "number")
243
251
  item.addChoices({ name: choice.name, value: choice.value });
244
252
  return item;
245
253
  }),
246
- booleen: () => builder.addBooleanOption(item => item.setName(option.name).setDescription(option.description).setRequired(option.required))
254
+ booleen: () => builder.addBooleanOption(item => item.setName(option.name).setDescription(option.description).setRequired(option.required)),
255
+ salon: () => builder.addChannelOption(item => item.setName(option.name).setDescription(option.description).setRequired(option.required))
247
256
  }[option.type];
248
257
  add();
249
258
  }
@@ -287,10 +296,14 @@ class FbpCompiler {
287
296
  const number = interaction.options.getInteger(option.name);
288
297
  value = number === null ? null : String(number);
289
298
  }
290
- else {
299
+ else if (option.type === "booleen") {
291
300
  const boolean = interaction.options.getBoolean(option.name);
292
301
  value = boolean === null ? null : String(boolean);
293
302
  }
303
+ else {
304
+ const channel = interaction.options.getChannel(option.name);
305
+ value = channel === null ? null : "#" + channel.name;
306
+ }
294
307
  if (value === null && option.required) {
295
308
  await interaction.reply({ content: "Option obligatoire indisponible : " + option.name, ephemeral: true });
296
309
  return;
@@ -396,6 +409,8 @@ class FbpCompiler {
396
409
  throw new errors_1.FbpError("La valeur d'un choix texte doit être du texte.", undefined, line);
397
410
  if (expectedType === "entier" && (typeof choiceValue !== "number" || !Number.isInteger(choiceValue)))
398
411
  throw new errors_1.FbpError("La valeur d'un choix entier doit être un nombre entier.", undefined, line);
412
+ if (option.minValue !== undefined || option.maxValue !== undefined)
413
+ throw new errors_1.FbpError("Une option avec des limites numériques ne peut pas recevoir de choix prédéfinis.", undefined, line);
399
414
  const choices = option.choices ?? (option.choices = []);
400
415
  if (choices.some(choice => choice.name === choiceName || choice.value === choiceValue))
401
416
  throw new errors_1.FbpError("Ce nom ou cette valeur de choix existe déjà.", undefined, line);
@@ -404,9 +419,30 @@ class FbpCompiler {
404
419
  choices.push({ name: choiceName, value: choiceValue });
405
420
  return;
406
421
  }
407
- if (name === "discordOptionTexte" || name === "discordOptionNombre" || name === "discordOptionEntier" || name === "discordOptionBooleen") {
422
+ if (name === "discordOptionNombreLimites" || name === "discordOptionEntierLimites") {
423
+ if (values.length !== 4 || typeof values[0] !== "string" || typeof values[1] !== "string" || typeof values[2] !== "number" || typeof values[3] !== "number") {
424
+ throw new errors_1.FbpError("Utilisation : discordOptionNombreLimites(commande, option, minimum, maximum) ou discordOptionEntierLimites(...).", undefined, line);
425
+ }
426
+ const [commandName, optionName, minimum, maximum] = values;
427
+ const command = this.discordCommands.get(commandName);
428
+ if (!command)
429
+ throw new errors_1.FbpError("La commande « " + commandName + " » n'est pas déclarée.", undefined, line);
430
+ const expectedType = name === "discordOptionNombreLimites" ? "nombre" : "entier";
431
+ const option = (command.options ?? []).find(item => item.name === optionName);
432
+ if (!option || option.type !== expectedType)
433
+ throw new errors_1.FbpError("L'option « " + optionName + " » n'existe pas ou n'a pas le type numérique attendu.", undefined, line);
434
+ if (!Number.isFinite(minimum) || !Number.isFinite(maximum) || minimum > maximum || (expectedType === "entier" && (!Number.isInteger(minimum) || !Number.isInteger(maximum)))) {
435
+ throw new errors_1.FbpError("Les limites doivent être des nombres valides, minimum inférieur ou égal au maximum ; elles doivent être entières pour une option entière.", undefined, line);
436
+ }
437
+ if (option.choices?.length)
438
+ throw new errors_1.FbpError("Une option avec des choix prédéfinis ne peut pas recevoir de limites numériques.", undefined, line);
439
+ option.minValue = minimum;
440
+ option.maxValue = maximum;
441
+ return;
442
+ }
443
+ if (name === "discordOptionTexte" || name === "discordOptionNombre" || name === "discordOptionEntier" || name === "discordOptionBooleen" || name === "discordOptionSalon") {
408
444
  if (values.length < 3 || values.length > 4 || values.some(value => typeof value !== "string" && typeof value !== "boolean")) {
409
- throw new errors_1.FbpError("Utilisation : discordOptionTexte/Nombre/Entier/Booleen(nomCommande, nomOption, description, obligatoire).", undefined, line);
445
+ throw new errors_1.FbpError("Utilisation : discordOptionTexte/Nombre/Entier/Booleen/Salon(nomCommande, nomOption, description, obligatoire).", undefined, line);
410
446
  }
411
447
  const [commandName, optionName, description] = values;
412
448
  const required = values.length === 4 ? values[3] : false;
@@ -425,7 +461,7 @@ class FbpCompiler {
425
461
  throw new errors_1.FbpError("L'option « " + optionName + " » existe déjà pour cette commande.", undefined, line);
426
462
  if (options.length + (command.type === "embed" && command.userOption ? 1 : 0) >= 25)
427
463
  throw new errors_1.FbpError("Une commande slash Discord ne peut pas contenir plus de 25 options.", undefined, line);
428
- const type = name === "discordOptionTexte" ? "texte" : name === "discordOptionNombre" ? "nombre" : name === "discordOptionEntier" ? "entier" : "booleen";
464
+ const type = name === "discordOptionTexte" ? "texte" : name === "discordOptionNombre" ? "nombre" : name === "discordOptionEntier" ? "entier" : name === "discordOptionBooleen" ? "booleen" : "salon";
429
465
  options.push({ name: optionName, description, type, required });
430
466
  return;
431
467
  }
@@ -0,0 +1,21 @@
1
+ {
2
+ "brackets": [
3
+ ["{", "}"],
4
+ ["(", ")"],
5
+ ["[", "]"]
6
+ ],
7
+ "autoClosingPairs": [
8
+ ["{", "}"],
9
+ ["(", ")"],
10
+ ["[", "]"],
11
+ ["\"", "\""],
12
+ ["'", "'"]
13
+ ],
14
+ "surroundingPairs": [
15
+ ["{", "}"],
16
+ ["(", ")"],
17
+ ["[", "]"],
18
+ ["\"", "\""],
19
+ ["'", "'"]
20
+ ]
21
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "fbp-language",
3
3
  "displayName": "FBP - French Bot Programming",
4
- "description": "Langage FBP avec options slash Discord, choix prédéfinis et embeds dynamiques.",
5
- "version": "1.1.6",
4
+ "description": "Langage FBP avec compilateur, commandes Discord et support VS Code.",
5
+ "version": "1.1.9",
6
6
  "type": "commonjs",
7
7
  "main": "dist/compiler.js",
8
8
  "bin": {
@@ -10,7 +10,13 @@
10
10
  },
11
11
  "files": [
12
12
  "dist/",
13
- "README.md"
13
+ "README.md",
14
+ "syntaxes/",
15
+ "assets/",
16
+ "themes/",
17
+ "vscode-extension/",
18
+ "language-configuration.json",
19
+ "package.json"
14
20
  ],
15
21
  "repository": {
16
22
  "type": "git",
@@ -28,7 +34,8 @@
28
34
  "cli",
29
35
  "discord",
30
36
  "slash-commands",
31
- "bot"
37
+ "bot",
38
+ "vscode-extension"
32
39
  ],
33
40
  "scripts": {
34
41
  "build": "tsc -p tsconfig.json",
@@ -49,5 +56,34 @@
49
56
  "dependencies": {
50
57
  "discord.js": "^14.19.3",
51
58
  "dotenv": "^16.4.7"
59
+ },
60
+ "contributes": {
61
+ "languages": [
62
+ {
63
+ "id": "fbp",
64
+ "aliases": [
65
+ "FBP",
66
+ "fbp"
67
+ ],
68
+ "extensions": [
69
+ ".fbp"
70
+ ],
71
+ "configuration": "./language-configuration.json"
72
+ }
73
+ ],
74
+ "grammars": [
75
+ {
76
+ "language": "fbp",
77
+ "scopeName": "source.fbp",
78
+ "path": "./syntaxes/fbp.tmLanguage.json"
79
+ }
80
+ ],
81
+ "iconThemes": [
82
+ {
83
+ "id": "fbp-file-icons",
84
+ "label": "FBP File Icons",
85
+ "path": "./themes/fbp-icon-theme.json"
86
+ }
87
+ ]
52
88
  }
53
89
  }
@@ -0,0 +1,100 @@
1
+ {
2
+ "scopeName": "source.fbp",
3
+ "name": "FBP",
4
+ "patterns": [
5
+ {
6
+ "include": "#strings"
7
+ },
8
+ {
9
+ "include": "#numbers"
10
+ },
11
+ {
12
+ "include": "#keywords"
13
+ },
14
+ {
15
+ "include": "#booleans"
16
+ },
17
+ {
18
+ "include": "#function-declarations"
19
+ },
20
+ {
21
+ "include": "#function-calls"
22
+ },
23
+ {
24
+ "include": "#assignments"
25
+ },
26
+ {
27
+ "include": "#operators"
28
+ },
29
+ {
30
+ "include": "#punctuation"
31
+ }
32
+ ],
33
+ "repository": {
34
+ "strings": {
35
+ "name": "string.quoted.double.fbp",
36
+ "begin": "\"",
37
+ "beginCaptures": {
38
+ "0": {
39
+ "name": "punctuation.definition.string.begin.fbp"
40
+ }
41
+ },
42
+ "end": "\"",
43
+ "endCaptures": {
44
+ "0": {
45
+ "name": "punctuation.definition.string.end.fbp"
46
+ }
47
+ },
48
+ "patterns": [
49
+ {
50
+ "name": "constant.character.escape.fbp",
51
+ "match": "\\\\."
52
+ }
53
+ ]
54
+ },
55
+ "numbers": {
56
+ "name": "constant.numeric.fbp",
57
+ "match": "\\b\\d+(?:\\.\\d+)?\\b"
58
+ },
59
+ "keywords": {
60
+ "name": "keyword.control.fbp",
61
+ "match": "\\b(?:import|de)\\b"
62
+ },
63
+ "booleans": {
64
+ "name": "constant.language.boolean.fbp",
65
+ "match": "\\b(?:true|false)\\b"
66
+ },
67
+ "function-declarations": {
68
+ "match": "\\b([\\p{L}_][\\p{L}\\p{N}_]*)\\s*(?=\\(\\s*\\)\\s*\\{)",
69
+ "captures": {
70
+ "1": {
71
+ "name": "entity.name.function.fbp"
72
+ }
73
+ }
74
+ },
75
+ "function-calls": {
76
+ "match": "\\b([\\p{L}_][\\p{L}\\p{N}_]*)\\s*(?=\\()",
77
+ "captures": {
78
+ "1": {
79
+ "name": "support.function.fbp"
80
+ }
81
+ }
82
+ },
83
+ "assignments": {
84
+ "match": "\\b([\\p{L}_][\\p{L}\\p{N}_]*)\\s*(?==)",
85
+ "captures": {
86
+ "1": {
87
+ "name": "variable.other.assignment.fbp"
88
+ }
89
+ }
90
+ },
91
+ "operators": {
92
+ "name": "keyword.operator.fbp",
93
+ "match": "(?:=|\\+|\\-|\\*|/|==|!=|<=|>=)"
94
+ },
95
+ "punctuation": {
96
+ "name": "punctuation.section.fbp",
97
+ "match": "[{}()\\[\\],.]"
98
+ }
99
+ }
100
+ }
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "FBP Colors",
3
+ "type": "dark",
4
+ "tokenColors": [
5
+ {
6
+ "scope": [
7
+ "keyword.control.fbp"
8
+ ],
9
+ "settings": {
10
+ "foreground": "#C792EA",
11
+ "fontStyle": "bold"
12
+ }
13
+ },
14
+ {
15
+ "scope": [
16
+ "entity.name.function.fbp"
17
+ ],
18
+ "settings": {
19
+ "foreground": "#82AAFF",
20
+ "fontStyle": "bold"
21
+ }
22
+ },
23
+ {
24
+ "scope": [
25
+ "support.function.fbp"
26
+ ],
27
+ "settings": {
28
+ "foreground": "#89DDFF"
29
+ }
30
+ },
31
+ {
32
+ "scope": [
33
+ "string.quoted.double.fbp"
34
+ ],
35
+ "settings": {
36
+ "foreground": "#C3E88D"
37
+ }
38
+ },
39
+ {
40
+ "scope": [
41
+ "constant.numeric.fbp"
42
+ ],
43
+ "settings": {
44
+ "foreground": "#F78C6C"
45
+ }
46
+ },
47
+ {
48
+ "scope": [
49
+ "constant.language.boolean.fbp"
50
+ ],
51
+ "settings": {
52
+ "foreground": "#FF9CAC",
53
+ "fontStyle": "bold"
54
+ }
55
+ },
56
+ {
57
+ "scope": [
58
+ "variable.other.assignment.fbp"
59
+ ],
60
+ "settings": {
61
+ "foreground": "#F4B860"
62
+ }
63
+ },
64
+ {
65
+ "scope": [
66
+ "keyword.operator.fbp"
67
+ ],
68
+ "settings": {
69
+ "foreground": "#89DDFF"
70
+ }
71
+ },
72
+ {
73
+ "scope": [
74
+ "punctuation.section.fbp"
75
+ ],
76
+ "settings": {
77
+ "foreground": "#AAB3C5"
78
+ }
79
+ },
80
+ {
81
+ "scope": [
82
+ "constant.character.escape.fbp"
83
+ ],
84
+ "settings": {
85
+ "foreground": "#FFCB6B"
86
+ }
87
+ }
88
+ ]
89
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "vscode://schemas/icon-theme",
3
+ "iconDefinitions": {
4
+ "_fbp": {
5
+ "iconPath": "../assets/fbp-logo.svg"
6
+ }
7
+ },
8
+ "fileExtensions": {
9
+ "fbp": "_fbp"
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 128">
2
+ <title>FBP file icon</title>
3
+ <g fill="#718DB5" font-family="Arial, Helvetica, sans-serif" font-size="88" font-weight="600" text-anchor="middle">
4
+ <text x="48" y="94">{</text>
5
+ <text x="128" y="94">B</text>
6
+ <text x="208" y="94">}</text>
7
+ </g>
8
+ </svg>
@@ -0,0 +1,21 @@
1
+ {
2
+ "brackets": [
3
+ ["{", "}"],
4
+ ["(", ")"],
5
+ ["[", "]"]
6
+ ],
7
+ "autoClosingPairs": [
8
+ ["{", "}"],
9
+ ["(", ")"],
10
+ ["[", "]"],
11
+ ["\"", "\""],
12
+ ["'", "'"]
13
+ ],
14
+ "surroundingPairs": [
15
+ ["{", "}"],
16
+ ["(", ")"],
17
+ ["[", "]"],
18
+ ["\"", "\""],
19
+ ["'", "'"]
20
+ ]
21
+ }
@@ -0,0 +1,46 @@
1
+ {
2
+ "name": "fbp-language",
3
+ "displayName": "FBP Language Support",
4
+ "description": "Coloration syntaxique, reconnaissance des fichiers .fbp et thème d'icônes FBP.",
5
+ "version": "1.1.9",
6
+ "publisher": "gabyy1",
7
+ "engines": {
8
+ "vscode": "^1.80.0"
9
+ },
10
+ "categories": [
11
+ "Programming Languages",
12
+ "Themes"
13
+ ],
14
+ "extensionKind": [
15
+ "workspace"
16
+ ],
17
+ "contributes": {
18
+ "languages": [
19
+ {
20
+ "id": "fbp",
21
+ "aliases": [
22
+ "FBP",
23
+ "fbp"
24
+ ],
25
+ "extensions": [
26
+ ".fbp"
27
+ ],
28
+ "configuration": "./language-configuration.json"
29
+ }
30
+ ],
31
+ "grammars": [
32
+ {
33
+ "language": "fbp",
34
+ "scopeName": "source.fbp",
35
+ "path": "./syntaxes/fbp.tmLanguage.json"
36
+ }
37
+ ],
38
+ "iconThemes": [
39
+ {
40
+ "id": "fbp-file-icons",
41
+ "label": "FBP File Icons",
42
+ "path": "./themes/fbp-icon-theme.json"
43
+ }
44
+ ]
45
+ }
46
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "scopeName": "source.fbp",
3
+ "name": "FBP",
4
+ "patterns": [
5
+ { "include": "#comments" },
6
+ { "include": "#strings" },
7
+ { "include": "#numbers" },
8
+ { "include": "#keywords" },
9
+ { "include": "#booleans" },
10
+ { "include": "#function-declarations" },
11
+ { "include": "#function-calls" },
12
+ { "include": "#assignments" },
13
+ { "include": "#operators" },
14
+ { "include": "#punctuation" }
15
+ ],
16
+ "repository": {
17
+ "comments": {
18
+ "patterns": [
19
+ { "name": "comment.line.double-slash.fbp", "match": "//.*$" },
20
+ { "name": "comment.line.number-sign.fbp", "match": "#.*$" }
21
+ ]
22
+ },
23
+ "strings": {
24
+ "name": "string.quoted.double.fbp",
25
+ "begin": "\"",
26
+ "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.fbp" } },
27
+ "end": "\"",
28
+ "endCaptures": { "0": { "name": "punctuation.definition.string.end.fbp" } },
29
+ "patterns": [{ "name": "constant.character.escape.fbp", "match": "\\\\." }]
30
+ },
31
+ "numbers": { "name": "constant.numeric.fbp", "match": "\\b\\d+(?:\\.\\d+)?\\b" },
32
+ "keywords": { "name": "keyword.control.fbp", "match": "\\b(?:import|de)\\b" },
33
+ "booleans": { "name": "constant.language.boolean.fbp", "match": "\\b(?:true|false)\\b" },
34
+ "function-declarations": {
35
+ "match": "\\b([\\p{L}_][\\p{L}\\p{N}_]*)\\s*(?=\\(\\s*\\)\\s*\\{)",
36
+ "captures": { "1": { "name": "entity.name.function.fbp" } }
37
+ },
38
+ "function-calls": {
39
+ "match": "\\b([\\p{L}_][\\p{L}\\p{N}_]*)\\s*(?=\\()",
40
+ "captures": { "1": { "name": "support.function.fbp" } }
41
+ },
42
+ "assignments": {
43
+ "match": "\\b([\\p{L}_][\\p{L}\\p{N}_]*)\\s*(?==)",
44
+ "captures": { "1": { "name": "variable.other.assignment.fbp" } }
45
+ },
46
+ "operators": { "name": "keyword.operator.fbp", "match": "(?:=|\\+|\\-|\\*|/|==|!=|<=|>=)" },
47
+ "punctuation": { "name": "punctuation.section.fbp", "match": "[{}()\\[\\],.]" }
48
+ }
49
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "$schema": "vscode://schemas/icon-theme",
3
+ "iconDefinitions": {
4
+ "_fbp": {
5
+ "iconPath": "../assets/fbp-logo.svg"
6
+ }
7
+ },
8
+ "fileExtensions": {
9
+ "fbp": "_fbp"
10
+ }
11
+ }