bayda-maghreb 1.0.5 → 1.0.6
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/data/dialects/kab.json +1 -39
- package/data/dialects/kabyle.json +1 -39
- package/hello.kab.bayda +9 -0
- package/package.json +1 -1
- package/run-kab.js +15 -0
- package/test.kab.bayda +3 -0
package/data/dialects/kab.json
CHANGED
|
@@ -5,14 +5,9 @@
|
|
|
5
5
|
"ila": "if",
|
|
6
6
|
"ma_yella": "if",
|
|
7
7
|
"awla": "else",
|
|
8
|
-
"neɣ": "else",
|
|
9
8
|
"ma_ulac": "else",
|
|
10
|
-
"ma_yella_ur": "else if",
|
|
11
|
-
"i": "for",
|
|
12
|
-
"deg": "for",
|
|
13
9
|
"asmi": "while",
|
|
14
10
|
"armi": "while",
|
|
15
|
-
"efk": "do",
|
|
16
11
|
"bedd": "break",
|
|
17
12
|
"kemmel": "continue",
|
|
18
13
|
"afecku": "function",
|
|
@@ -22,17 +17,10 @@
|
|
|
22
17
|
"tidet": "true",
|
|
23
18
|
"tikerkas": "false",
|
|
24
19
|
"ulac": "null",
|
|
25
|
-
"ulac_akra": "null",
|
|
26
20
|
"sider": "import",
|
|
27
21
|
"sufɣ": "export",
|
|
28
22
|
"taggayt": "class",
|
|
29
23
|
"amaynur": "new",
|
|
30
|
-
"neki": "this",
|
|
31
|
-
"nec": "this",
|
|
32
|
-
"hat": "let",
|
|
33
|
-
"ili": "let",
|
|
34
|
-
"ur_nbeddel": "const",
|
|
35
|
-
"ahet": "var",
|
|
36
24
|
"asekfel": "try",
|
|
37
25
|
"ttef": "catch",
|
|
38
26
|
"taggara": "finally",
|
|
@@ -42,20 +30,13 @@
|
|
|
42
30
|
"umḍan": "Number",
|
|
43
31
|
"tamsirt": "Object",
|
|
44
32
|
"tabadut": "Boolean",
|
|
45
|
-
"tidukla": "Map",
|
|
46
|
-
"agraw": "Set",
|
|
47
33
|
"asizdeg": "filter",
|
|
48
34
|
"asnifel": "map",
|
|
49
35
|
"agmer": "reduce",
|
|
50
36
|
"nadi": "find",
|
|
51
|
-
"af": "get",
|
|
52
|
-
"sbedd": "set",
|
|
53
37
|
"arnu": "push",
|
|
54
38
|
"kkes": "pop",
|
|
55
|
-
"
|
|
56
|
-
"meslay": "log",
|
|
57
|
-
"print": "log",
|
|
58
|
-
"awal": "log",
|
|
39
|
+
"meslay": "console.log",
|
|
59
40
|
"seqdec": "sort",
|
|
60
41
|
"beddel": "replace",
|
|
61
42
|
"ferren": "split",
|
|
@@ -63,21 +44,6 @@
|
|
|
63
44
|
"semsawi": "equal",
|
|
64
45
|
"ameqqran": "greater",
|
|
65
46
|
"ameẓyan": "less",
|
|
66
|
-
"amar": "and",
|
|
67
|
-
"neɣ": "or",
|
|
68
|
-
"ur": "not",
|
|
69
|
-
"yella": "exists",
|
|
70
|
-
"ulac": "empty",
|
|
71
|
-
"seg": "from",
|
|
72
|
-
"ɣer": "to",
|
|
73
|
-
"di": "in",
|
|
74
|
-
"s": "with",
|
|
75
|
-
"ak": "with",
|
|
76
|
-
"ɣef": "on",
|
|
77
|
-
"ddaw": "under",
|
|
78
|
-
"nnig": "above",
|
|
79
|
-
"zdat": "before",
|
|
80
|
-
"deffir": "after",
|
|
81
47
|
"tikli": "loop",
|
|
82
48
|
"tikelt": "iteration",
|
|
83
49
|
"aɣbalu": "source",
|
|
@@ -95,18 +61,14 @@
|
|
|
95
61
|
"akal": "global",
|
|
96
62
|
"agmam": "module",
|
|
97
63
|
"tawuri": "process",
|
|
98
|
-
"talɣa": "args",
|
|
99
64
|
"inadi": "index",
|
|
100
65
|
"amḍan": "count",
|
|
101
66
|
"amzwaru": "first",
|
|
102
67
|
"aneggaru": "last",
|
|
103
68
|
"talemmast": "middle",
|
|
104
|
-
"aḥric": "slice",
|
|
105
|
-
"dukel": "concat",
|
|
106
69
|
"ini": "say",
|
|
107
70
|
"steqsi": "prompt",
|
|
108
71
|
"wali": "check",
|
|
109
|
-
"ferren": "parse",
|
|
110
72
|
"suɣel": "stringify"
|
|
111
73
|
}
|
|
112
74
|
}
|
|
@@ -5,14 +5,9 @@
|
|
|
5
5
|
"ila": "if",
|
|
6
6
|
"ma_yella": "if",
|
|
7
7
|
"awla": "else",
|
|
8
|
-
"neɣ": "else",
|
|
9
8
|
"ma_ulac": "else",
|
|
10
|
-
"ma_yella_ur": "else if",
|
|
11
|
-
"i": "for",
|
|
12
|
-
"deg": "for",
|
|
13
9
|
"asmi": "while",
|
|
14
10
|
"armi": "while",
|
|
15
|
-
"efk": "do",
|
|
16
11
|
"bedd": "break",
|
|
17
12
|
"kemmel": "continue",
|
|
18
13
|
"afecku": "function",
|
|
@@ -22,17 +17,10 @@
|
|
|
22
17
|
"tidet": "true",
|
|
23
18
|
"tikerkas": "false",
|
|
24
19
|
"ulac": "null",
|
|
25
|
-
"ulac_akra": "null",
|
|
26
20
|
"sider": "import",
|
|
27
21
|
"sufɣ": "export",
|
|
28
22
|
"taggayt": "class",
|
|
29
23
|
"amaynur": "new",
|
|
30
|
-
"neki": "this",
|
|
31
|
-
"nec": "this",
|
|
32
|
-
"hat": "let",
|
|
33
|
-
"ili": "let",
|
|
34
|
-
"ur_nbeddel": "const",
|
|
35
|
-
"ahet": "var",
|
|
36
24
|
"asekfel": "try",
|
|
37
25
|
"ttef": "catch",
|
|
38
26
|
"taggara": "finally",
|
|
@@ -42,20 +30,13 @@
|
|
|
42
30
|
"umḍan": "Number",
|
|
43
31
|
"tamsirt": "Object",
|
|
44
32
|
"tabadut": "Boolean",
|
|
45
|
-
"tidukla": "Map",
|
|
46
|
-
"agraw": "Set",
|
|
47
33
|
"asizdeg": "filter",
|
|
48
34
|
"asnifel": "map",
|
|
49
35
|
"agmer": "reduce",
|
|
50
36
|
"nadi": "find",
|
|
51
|
-
"af": "get",
|
|
52
|
-
"sbedd": "set",
|
|
53
37
|
"arnu": "push",
|
|
54
38
|
"kkes": "pop",
|
|
55
|
-
"
|
|
56
|
-
"meslay": "log",
|
|
57
|
-
"print": "log",
|
|
58
|
-
"awal": "log",
|
|
39
|
+
"meslay": "console.log",
|
|
59
40
|
"seqdec": "sort",
|
|
60
41
|
"beddel": "replace",
|
|
61
42
|
"ferren": "split",
|
|
@@ -63,21 +44,6 @@
|
|
|
63
44
|
"semsawi": "equal",
|
|
64
45
|
"ameqqran": "greater",
|
|
65
46
|
"ameẓyan": "less",
|
|
66
|
-
"amar": "and",
|
|
67
|
-
"neɣ": "or",
|
|
68
|
-
"ur": "not",
|
|
69
|
-
"yella": "exists",
|
|
70
|
-
"ulac": "empty",
|
|
71
|
-
"seg": "from",
|
|
72
|
-
"ɣer": "to",
|
|
73
|
-
"di": "in",
|
|
74
|
-
"s": "with",
|
|
75
|
-
"ak": "with",
|
|
76
|
-
"ɣef": "on",
|
|
77
|
-
"ddaw": "under",
|
|
78
|
-
"nnig": "above",
|
|
79
|
-
"zdat": "before",
|
|
80
|
-
"deffir": "after",
|
|
81
47
|
"tikli": "loop",
|
|
82
48
|
"tikelt": "iteration",
|
|
83
49
|
"aɣbalu": "source",
|
|
@@ -95,18 +61,14 @@
|
|
|
95
61
|
"akal": "global",
|
|
96
62
|
"agmam": "module",
|
|
97
63
|
"tawuri": "process",
|
|
98
|
-
"talɣa": "args",
|
|
99
64
|
"inadi": "index",
|
|
100
65
|
"amḍan": "count",
|
|
101
66
|
"amzwaru": "first",
|
|
102
67
|
"aneggaru": "last",
|
|
103
68
|
"talemmast": "middle",
|
|
104
|
-
"aḥric": "slice",
|
|
105
|
-
"dukel": "concat",
|
|
106
69
|
"ini": "say",
|
|
107
70
|
"steqsi": "prompt",
|
|
108
71
|
"wali": "check",
|
|
109
|
-
"ferren": "parse",
|
|
110
72
|
"suɣel": "stringify"
|
|
111
73
|
}
|
|
112
74
|
}
|
package/hello.kab.bayda
ADDED
package/package.json
CHANGED
package/run-kab.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import fs from 'fs'
|
|
2
|
+
import { createRequire } from 'module'
|
|
3
|
+
const require = createRequire(import.meta.url)
|
|
4
|
+
const kab = require('./data/dialects/kabyle.json')
|
|
5
|
+
|
|
6
|
+
let file = process.argv[2]
|
|
7
|
+
if(!file){ console.log("Usage: node run-kab.js file.kab.bayda"); process.exit(1) }
|
|
8
|
+
|
|
9
|
+
let code = fs.readFileSync(file,'utf8')
|
|
10
|
+
let entries = Object.entries(kab.keywords).sort((a,b)=>b[0].length-a[0].length)
|
|
11
|
+
for(let [k,v] of entries){
|
|
12
|
+
let en = v==='log'?'console.log':v
|
|
13
|
+
code = code.replace(new RegExp("\\b"+k+"\\b","g"), en)
|
|
14
|
+
}
|
|
15
|
+
eval(code)
|
package/test.kab.bayda
ADDED