amr-lang 1.0.5 → 1.0.7
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 +4 -16
- package/package.json +1 -1
- package/src/lexer.ts +2 -2
package/README.md
CHANGED
|
@@ -16,19 +16,7 @@ npm install -g amr-lang
|
|
|
16
16
|
npm install amr-lang
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
### For development
|
|
20
19
|
|
|
21
|
-
```bash
|
|
22
|
-
# Clone the repository
|
|
23
|
-
git clone https://github.com/amrelsherbiny/My-Lang.git
|
|
24
|
-
cd My-Lang
|
|
25
|
-
|
|
26
|
-
# Install dependencies
|
|
27
|
-
npm install
|
|
28
|
-
|
|
29
|
-
# Link globally to use the `amr` command
|
|
30
|
-
npm link
|
|
31
|
-
```
|
|
32
20
|
|
|
33
21
|
## Usage
|
|
34
22
|
|
|
@@ -96,8 +84,8 @@ make add(a, b) {
|
|
|
96
84
|
show add(10, 20)
|
|
97
85
|
|
|
98
86
|
# Arabic version
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
اعمل multiply(x, y) {
|
|
88
|
+
رجع x * y
|
|
101
89
|
}
|
|
102
90
|
```
|
|
103
91
|
|
|
@@ -159,8 +147,8 @@ show 10 # Inline comment
|
|
|
159
147
|
### Arabic Keywords (عربي)
|
|
160
148
|
- `خلي` - Variable declaration (let)
|
|
161
149
|
- `اطبع` - Print output (show)
|
|
162
|
-
-
|
|
163
|
-
-
|
|
150
|
+
- `اعمل` - Function declaration (make)
|
|
151
|
+
- `رجع` - Return from function (return)
|
|
164
152
|
- `اذا` - If statement (when)
|
|
165
153
|
- `والا` - Else statement (otherwise)
|
|
166
154
|
- `كرر` - While loop (loop)
|
package/package.json
CHANGED
package/src/lexer.ts
CHANGED
|
@@ -10,8 +10,8 @@ const keywords = ["let", "show", "make", "return", "when", "otherwise", "loop"];
|
|
|
10
10
|
const arabicKeywords: Record<string, string> = {
|
|
11
11
|
"خلي": "LET",
|
|
12
12
|
"اطبع": "SHOW",
|
|
13
|
-
"
|
|
14
|
-
"
|
|
13
|
+
"اعمل": "MAKE",
|
|
14
|
+
"رجع": "RETURN",
|
|
15
15
|
"اذا": "WHEN",
|
|
16
16
|
"والا": "OTHERWISE",
|
|
17
17
|
"كرر": "LOOP"
|