BanglaScript Syntax Highlighter for Visual Studio Code
This Visual Studio Code extension provides syntax highlighting for BanglaScript, a fictional programming language inspired by Bangla words, designed to make programming more accessible to Bengali speakers. It highlights keywords, functions, variables, constants, comments, and strings in BanglaScript code files, making the development experience more intuitive.
Features
- BanglaScript Syntax Support: Syntax highlighting for various BanglaScript keywords, functions, and control structures.
- Custom Keyword Mapping: Includes a dictionary of BanglaScript-to-JavaScript mappings, enabling seamless code writing in BanglaScript and transpiling to JavaScript.
- Comment and String Highlighting: Highlights comments (
// ...
) and strings (" ... "
).
- Error-Free Development: Enhanced readability of BanglaScript code with color-coded keywords, functions, and variables.
Keywords Supported
This extension supports the following BanglaScript keywords:
Control Keywords
funde
(Function declaration)
jodi
(if statement)
naile
(else statement)
bar-bar
(for loop)
ghurtey
(while loop)
arre bhai
(try block)
bujhso na
(catch block)
jhamela shesh
(finally block)
Other Keywords
oi mama
(return statement)
baba re
(throw statement)
matha noshto
(null value)
besh besh
(true boolean)
na re bhai
(false boolean)
shuru theke
(loop or process start)
shesh porjonto
(loop or process end)
Function and Console Keywords
bolchi
(console.log)
tui genius
(console.info)
arektu boro
(console.warn)
katlay porbi
(console.error)
Variables
bro
(variable declaration)
taka
(example variable)
Installation
To install this extension, follow these steps:
- Open Visual Studio Code.
- Press
Ctrl + P
and enter:
ext install <your-username>.banglascript-syntax-highlighter
- Or you can install it directly from the VS Code marketplace by searching for BanglaScript Syntax Highlighter.
Usage
- Open or create a file with a
.bns
extension in Visual Studio Code.
- Start writing your BanglaScript code using Bangla keywords like
funde
, jodi
, bolchi
, etc.
- The extension will automatically highlight the syntax according to the provided patterns.
- To transpile the code to JavaScript, run the
transpiler.js
script provided (refer to the example in the script for usage).
Example Code
// Sample BanglaScript Code
bro taka = 100;
funde discount(taka) {
jodi (taka > 500) {
bolchi("Boro taka:", taka - 50);
} naile {
bolchi("Chhoto taka:", taka - 10);
}
oi mama taka; // Return statement
}
discount(taka);
arre bhai {
bar-bar (bro i = 0; i < 5; i++) {
bolchi(`Loop e ase: ${i}`);
}
} bujhso na (err) {
katlay porbi("Error:", err);
} jhamela shesh {
bolchi("Shob thik ache");
}
Contribution
Feel free to contribute by opening issues or submitting pull requests. You can improve the syntax highlighting rules, add more keywords, or help with the documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.