bruhwhat 1.0.0__tar.gz

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.
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: bruhwhat
3
+ Version: 1.0.0
4
+ Summary: A funny programming language named BruhWhat
5
+ Home-page: https://github.com/ISviterI/bruhwhat
6
+ Author: Sviter
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/ISviterI/bruhwhat
9
+ Project-URL: Discord, https://discord.gg/MXv3KTFmPE
10
+ Project-URL: Wiki, https://github.com/ISviterI/bruhwhat/wiki
11
+ Keywords: bruhwhat,language,programming
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ Dynamic: author
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: keywords
22
+ Dynamic: license
23
+ Dynamic: project-url
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # BruhWhat
28
+
29
+ **BruhWhat** IS programming language made for fun and inspired by game baba IS you
30
+
31
+ ## Features
32
+ - py and terminal - these are commands that lets you use terminal and python commands
33
+ - exec - lets you execute code inside code inside code inside code
34
+ - IS - everything IS variable, no =, only IS
35
+ - ADD / SUB - math but without + and - because we only use words (not always)
36
+ - func - functions exist but who needs them when you have exec
37
+
38
+ ## Why BruhWhat?
39
+
40
+ Because you can write:
41
+ ```bruhwhat
42
+ exec exec exec exec exec print exec print exec lol exec IS py run_lines(["terminal echo lol"],{},{})
43
+ ```
44
+ And it works. Nobody knows how. Not even the creator.
45
+
46
+ ## How to run code?
47
+
48
+ ```python
49
+ import bruhwhat
50
+ bruhwhat.run("code.bw")
51
+ ```
52
+
53
+ ## Quick example of bw code
54
+ ```bw
55
+ # Making variables
56
+ ur_age exec IS input yoo what's ur age bro?:
57
+ this_year num IS 2026
58
+ # Calculating
59
+ ur_birthday math IS this_year - ur_age
60
+ print txt Here's ur birthday bro:
61
+ print ur_birthday
62
+ ```
@@ -0,0 +1,36 @@
1
+ # BruhWhat
2
+
3
+ **BruhWhat** IS programming language made for fun and inspired by game baba IS you
4
+
5
+ ## Features
6
+ - py and terminal - these are commands that lets you use terminal and python commands
7
+ - exec - lets you execute code inside code inside code inside code
8
+ - IS - everything IS variable, no =, only IS
9
+ - ADD / SUB - math but without + and - because we only use words (not always)
10
+ - func - functions exist but who needs them when you have exec
11
+
12
+ ## Why BruhWhat?
13
+
14
+ Because you can write:
15
+ ```bruhwhat
16
+ exec exec exec exec exec print exec print exec lol exec IS py run_lines(["terminal echo lol"],{},{})
17
+ ```
18
+ And it works. Nobody knows how. Not even the creator.
19
+
20
+ ## How to run code?
21
+
22
+ ```python
23
+ import bruhwhat
24
+ bruhwhat.run("code.bw")
25
+ ```
26
+
27
+ ## Quick example of bw code
28
+ ```bw
29
+ # Making variables
30
+ ur_age exec IS input yoo what's ur age bro?:
31
+ this_year num IS 2026
32
+ # Calculating
33
+ ur_birthday math IS this_year - ur_age
34
+ print txt Here's ur birthday bro:
35
+ print ur_birthday
36
+ ```
@@ -0,0 +1 @@
1
+ from .core import *
@@ -0,0 +1,157 @@
1
+ import os
2
+
3
+ def run(filename):
4
+ code = open(filename).read()
5
+ lines = code.split('\n')
6
+ run_lines(lines,{},{})
7
+ def error(exception):
8
+ print("ERROR:",exception)
9
+ def run_lines(lines:list, svars, sfuncs):
10
+ variables = svars
11
+ functions = sfuncs
12
+ creatingfunc = False
13
+ newfuncname = ""
14
+ result = None
15
+ for line in lines:
16
+ line = line.strip()
17
+ if not line or line.startswith("#"):
18
+ continue
19
+ space = line.split()
20
+ if not creatingfunc:
21
+ if " IS " in line:
22
+ split = line.split(" IS ")
23
+ split2 = split[0].split()
24
+ if split2[1] == "num":
25
+ variables[split2[0]] = int(split[1])
26
+ elif split2[1] == "txt":
27
+ variables[split2[0]] = split[1]
28
+ elif split2[1] == "exec":
29
+ exec_lines = split[1].split(";")
30
+ variables[split2[0]] = run_lines(exec_lines,variables,functions)
31
+ elif split2[1] == "math":
32
+ cool_space = split[1].split()
33
+ try:
34
+ if variables[cool_space[0]] and variables[cool_space[2]]:
35
+ if cool_space[1] == "+":
36
+ variables[split2[0]] = str(variables[cool_space[0]]) + str(variables[cool_space[2]]) or int(variables[cool_space[0]]) + int(variables[cool_space[2]])
37
+ elif cool_space[1] == "-":
38
+ variables[split2[0]] = int(variables[cool_space[0]]) - int(variables[cool_space[2]])
39
+ elif cool_space[1] == "*":
40
+ variables[split2[0]] = int(variables[cool_space[0]]) * int(variables[cool_space[2]])
41
+ elif cool_space[1] == "/":
42
+ variables[split2[0]] = int(variables[cool_space[0]]) / int(variables[cool_space[2]])
43
+
44
+ except Exception as e:
45
+ error(e)
46
+
47
+
48
+ elif space[0] == "print":
49
+ try:
50
+ print(float(space[1]))
51
+ except:
52
+ try:
53
+ print(variables[space[1]])
54
+ except:
55
+ if space[1] == "txt":
56
+ txt = ""
57
+ num = 0
58
+ for t in space:
59
+ num += 1
60
+ if num > 2:
61
+ txt += t
62
+ if num < len(space):
63
+ txt += " "
64
+ print(txt)
65
+ elif space[1] == "exec":
66
+ txt = ""
67
+ num = 0
68
+ for t in space:
69
+ num += 1
70
+ if num > 2:
71
+ txt += t
72
+ if num < len(space):
73
+ txt += " "
74
+ print(run_lines([txt],variables,functions))
75
+ else:
76
+ error(f"No variable, number, txt found in {space[1]}")
77
+
78
+ elif space[0] == "terminal":
79
+ txt = ""
80
+ num = 0
81
+ for t in space:
82
+ num += 1
83
+ if num >= 2:
84
+ txt += t + " "
85
+ os.system(txt)
86
+ elif space[0] == "func":
87
+ newfuncname = space[1]
88
+ functions[newfuncname] = ""
89
+ creatingfunc = True
90
+ elif " ADD " in line:
91
+ split = line.split(" ADD ")
92
+ var_name = split[0].strip()
93
+ value = split[1].strip()
94
+
95
+ if value in variables:
96
+ variables[var_name] += variables[value]
97
+ else:
98
+ try:
99
+ variables[var_name] += int(value)
100
+ except:
101
+ error(f"Cannot add {value} to {var_name}")
102
+ elif " SUB " in line:
103
+ split = line.split(" SUB ")
104
+ var_name = split[0].strip()
105
+ value = split[1].strip()
106
+
107
+ if value in variables:
108
+ variables[var_name] -= variables[value]
109
+ else:
110
+ try:
111
+ variables[var_name] -= int(value)
112
+ except:
113
+ error(f"Cannot subtract {value} from {var_name}")
114
+ elif space[0] == "input":
115
+ try:
116
+ txt = ""
117
+ num = 0
118
+ for t in space:
119
+ num += 1
120
+ if num > 1:
121
+ txt += t
122
+ if num < len(space):
123
+ txt += " "
124
+ result = input(txt)
125
+ return result
126
+ except:
127
+ error("No prompt provided")
128
+ elif space[0] == "py":
129
+ code = " ".join(space[1:])
130
+ exec(code)
131
+ elif space[0] == "exec":
132
+ txt = ""
133
+ num = 0
134
+ for t in space:
135
+ num += 1
136
+ if num >= 2:
137
+ txt += t + " "
138
+ run_lines([txt],variables,functions)
139
+ if creatingfunc and line != "end":
140
+ functions[newfuncname] += line + ":"
141
+ if creatingfunc and line == "end":
142
+ creatingfunc = False
143
+ line_without_is = f"{line[:len(line)-1]}"
144
+ line_has_is = False
145
+ for i in line:
146
+ if i == ":":
147
+ line_has_is = True
148
+ if functions.get(line_without_is) and line_has_is:
149
+ if True:
150
+ func_lines = []
151
+ num = 0
152
+ for i in functions[line_without_is].split(":"):
153
+ num += 1
154
+ if num > 1:
155
+ func_lines.append(i)
156
+ run_lines(func_lines, variables, functions)
157
+ return result
@@ -0,0 +1,62 @@
1
+ Metadata-Version: 2.4
2
+ Name: bruhwhat
3
+ Version: 1.0.0
4
+ Summary: A funny programming language named BruhWhat
5
+ Home-page: https://github.com/ISviterI/bruhwhat
6
+ Author: Sviter
7
+ License: MIT
8
+ Project-URL: Homepage, https://github.com/ISviterI/bruhwhat
9
+ Project-URL: Discord, https://discord.gg/MXv3KTFmPE
10
+ Project-URL: Wiki, https://github.com/ISviterI/bruhwhat/wiki
11
+ Keywords: bruhwhat,language,programming
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Requires-Python: >=3.7
15
+ Description-Content-Type: text/markdown
16
+ Dynamic: author
17
+ Dynamic: classifier
18
+ Dynamic: description
19
+ Dynamic: description-content-type
20
+ Dynamic: home-page
21
+ Dynamic: keywords
22
+ Dynamic: license
23
+ Dynamic: project-url
24
+ Dynamic: requires-python
25
+ Dynamic: summary
26
+
27
+ # BruhWhat
28
+
29
+ **BruhWhat** IS programming language made for fun and inspired by game baba IS you
30
+
31
+ ## Features
32
+ - py and terminal - these are commands that lets you use terminal and python commands
33
+ - exec - lets you execute code inside code inside code inside code
34
+ - IS - everything IS variable, no =, only IS
35
+ - ADD / SUB - math but without + and - because we only use words (not always)
36
+ - func - functions exist but who needs them when you have exec
37
+
38
+ ## Why BruhWhat?
39
+
40
+ Because you can write:
41
+ ```bruhwhat
42
+ exec exec exec exec exec print exec print exec lol exec IS py run_lines(["terminal echo lol"],{},{})
43
+ ```
44
+ And it works. Nobody knows how. Not even the creator.
45
+
46
+ ## How to run code?
47
+
48
+ ```python
49
+ import bruhwhat
50
+ bruhwhat.run("code.bw")
51
+ ```
52
+
53
+ ## Quick example of bw code
54
+ ```bw
55
+ # Making variables
56
+ ur_age exec IS input yoo what's ur age bro?:
57
+ this_year num IS 2026
58
+ # Calculating
59
+ ur_birthday math IS this_year - ur_age
60
+ print txt Here's ur birthday bro:
61
+ print ur_birthday
62
+ ```
@@ -0,0 +1,8 @@
1
+ README.md
2
+ setup.py
3
+ bruhwhat/__init__.py
4
+ bruhwhat/core.py
5
+ bruhwhat.egg-info/PKG-INFO
6
+ bruhwhat.egg-info/SOURCES.txt
7
+ bruhwhat.egg-info/dependency_links.txt
8
+ bruhwhat.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ bruhwhat
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,24 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="bruhwhat",
5
+ version="1.0.0",
6
+ author="Sviter",
7
+ description="A funny programming language named BruhWhat",
8
+ url="https://github.com/ISviterI/bruhwhat",
9
+ long_description=open("README.md", encoding="utf-8").read(),
10
+ long_description_content_type="text/markdown",
11
+ project_urls={
12
+ "Homepage": "https://github.com/ISviterI/bruhwhat",
13
+ "Discord": "https://discord.gg/MXv3KTFmPE",
14
+ "Wiki": "https://github.com/ISviterI/bruhwhat/wiki",
15
+ },
16
+ packages=find_packages(),
17
+ license="MIT",
18
+ python_requires=">=3.7",
19
+ classifiers=[
20
+ "Programming Language :: Python :: 3",
21
+ "License :: OSI Approved :: MIT License",
22
+ ],
23
+ keywords="bruhwhat,language,programming",
24
+ )