segd-lang 0.1.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,130 @@
1
+ # SEGD Language Specification
2
+
3
+ Copyright (c) 2026 Samiyyan Alam Mridha.
4
+ SEGD — Super Easy Game Development — is released under the [MIT License](LICENSE).
5
+ The MIT License does not grant trademark or brand rights in the SEGD name or logo.
6
+
7
+ SEGD (Super Easy Game Development) is a line-oriented language for 2D HTML5 games. It is implemented as a real lexer, parser, semantic analyzer, code generator, and browser runtime.
8
+
9
+ ## Design goals
10
+
11
+ - Natural English commands
12
+ - One operation per line
13
+ - Indentation for blocks instead of brackets
14
+ - No semicolons or required punctuation
15
+ - Familiar, consistent words: `make`, `set`, `move`, `if`, `on`, `play`
16
+ - Beginner-readable compiler errors
17
+
18
+ ## Project settings
19
+
20
+ ```segd
21
+ game title "My Game"
22
+ game width 960
23
+ game height 540
24
+ game fps 60
25
+ game background "#1b1f2a"
26
+ ```
27
+
28
+ ## Variables
29
+
30
+ ```segd
31
+ set score to 0
32
+ set speed to 5
33
+ set alive to true
34
+ set name to "Explorer"
35
+ add 10
36
+ subtract 2
37
+ ```
38
+
39
+ ## Objects
40
+
41
+ ```segd
42
+ make player hero at 100 100 size 40 40 color "#58a6ff"
43
+ make enemy monster at 700 300 size 50 50 image "monster.png"
44
+ make item coin at 500 200 size 25 25 color "#ffd700"
45
+ ```
46
+
47
+ Object kinds include `player`, `enemy`, `item`, or `object`.
48
+
49
+ ## Commands
50
+
51
+ ```segd
52
+ move hero left 5
53
+ jump hero force 500
54
+ delete coin
55
+ show hero
56
+ hide hero
57
+ set hero speed to 220
58
+ set hero gravity to 900
59
+ set hero x to 100
60
+ set hero y to 200
61
+ display "Hello!" at 20 40
62
+ say "Ready" at 20 80
63
+ play sound "jump.wav"
64
+ play music "level.wav"
65
+ stop music
66
+ volume 0.5
67
+ pause
68
+ resume
69
+ restart
70
+ end game
71
+ ```
72
+
73
+ ## Events
74
+
75
+ ```segd
76
+ on start
77
+ set score to 0
78
+
79
+ on update
80
+ if key left is down
81
+ move hero left 5
82
+
83
+ on key space
84
+ jump hero force 500
85
+
86
+ on collision hero coin
87
+ add 10
88
+ delete coin
89
+
90
+ every 1 seconds
91
+ set timer to true
92
+ ```
93
+
94
+ The `on mouse down`, `on key ...`, `on start`, `on update`, and `on collision` forms are supported.
95
+
96
+ ## Conditions
97
+
98
+ ```segd
99
+ if score > 10
100
+ if score >= 100
101
+ if score is equal to 50
102
+ if hero touches coin
103
+ if key left is down
104
+ if mouse is down
105
+ ```
106
+
107
+ Comparison operators are `>`, `<`, `>=`, `<=`, `=`, `==`, `is`, and `is not`.
108
+
109
+ ## Repetition
110
+
111
+ ```segd
112
+ repeat 10 times
113
+ add 1
114
+
115
+ while score < 100
116
+ add 1
117
+
118
+ forever
119
+ add 1
120
+ ```
121
+
122
+ Forever and repeat blocks execute in the browser runtime. Comments begin with `#`.
123
+
124
+ ## HTML5 export
125
+
126
+ `segd build main.segd -o build` creates `index.html`, `runtime.js`, `game.js`, and an `assets` folder. The export uses Canvas and Web Audio; it does not require Python in the browser.
127
+
128
+ ## Implementation status
129
+
130
+ The first release implements line-oriented parsing, semantic object checks, variables, Canvas objects, keyboard input, mouse input, collisions, text, image and sound hooks, game settings, timers/events, score, health, and HTML5 export. Some advanced animation, touch gestures, networking, and complex expression features remain planned.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Samiyyan Alam Mridha
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,90 @@
1
+ # SEGD License Guide
2
+
3
+ Copyright (c) 2026 Samiyyan Alam Mridha.
4
+
5
+ This guide summarizes the [MIT License](LICENSE) for SEGD. It is educational
6
+ information, not legal advice.
7
+
8
+ ## SEGD official identity and rights
9
+
10
+ SEGD — Super Easy Game Development — is the official project name.
11
+ The MIT License grants rights to the code and documentation covered by it.
12
+ It does not transfer ownership of the SEGD project name or the SEGD logo.
13
+ Using SEGD's logo or presenting a derivative work as the official SEGD project
14
+ does not become permitted merely because the source code is MIT-licensed.
15
+
16
+ ## What users may do
17
+
18
+ Subject to the MIT License:
19
+
20
+ - use SEGD privately or commercially;
21
+ - copy and modify SEGD;
22
+ - distribute original or modified copies;
23
+ - sublicense and distribute copies under the MIT terms;
24
+ - include SEGD in a larger product or service.
25
+
26
+ The software is provided without a warranty.
27
+
28
+ ## Distribution requirements
29
+
30
+ When redistributing the source or an executable/package that includes SEGD:
31
+
32
+ 1. Retain the copyright notice in the [LICENSE](LICENSE).
33
+ 2. Retain the complete MIT License text.
34
+ 3. Include the applicable notices for third-party components identified in
35
+ [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
36
+ 4. Do not imply that the SEGD maintainer or copyright holder endorses your
37
+ modified distribution unless that endorsement was given.
38
+
39
+ The license text may accompany source files or be included in a bundled
40
+ `LICENSE`, `NOTICE`, credits page, about screen, package metadata, or another
41
+ reasonable location where recipients can find it.
42
+
43
+ ## Why notices must be retained
44
+
45
+ Copyright notices identify the source and rights holders.
46
+ License text tells recipients exactly what rights they receive.
47
+ Removing or hiding these notices makes it harder for contributors and downstream
48
+ users to exercise and preserve their rights. It can also misrepresent
49
+ contributions or conceal third-party obligations.
50
+
51
+ ## Potential violations
52
+
53
+ The following can potentially violate the MIT License or applicable law:
54
+
55
+ - redistributing SEGD or a substantial copy without the copyright notice and
56
+ complete license text;
57
+ - falsely claiming that the SEGD copyright holder created or endorsed a
58
+ derivative product;
59
+ - presenting a third-party contribution as your own work;
60
+ - redistributing unlicensed or mislicensed assets or third-party code;
61
+ - representing a fork or unofficial product as an official SEGD release;
62
+ - using the SEGD name or logo as a trademark or brand identifier in a way that
63
+ improperly suggests official affiliation.
64
+
65
+ This list is general and a fact-specific legal assessment may differ.
66
+
67
+ ## Reporting a suspected violation
68
+
69
+ Report suspected copyright, license, asset, or brand misuse through the
70
+ repository's GitHub Issues page:
71
+ <https://github.com/Samiyyan/SEGD/issues>
72
+
73
+ Please include:
74
+
75
+ - the relevant public URL or repository;
76
+ - a description of the suspected use;
77
+ - the SEGD files, notices, or assets involved;
78
+ - where the missing notice or problematic copy appears;
79
+ - supporting links or archives, while avoiding private credentials or personal
80
+ data.
81
+
82
+ ## Enforcement and remedies
83
+
84
+ Copyright holders may seek legally available remedies for unauthorized use.
85
+ Those remedies, including injunctions or damages, may be determined by
86
+ applicable law and a court or other authorized proceeding.
87
+
88
+ This project does not establish an invented fixed fine or automatic financial
89
+ penalty. Financial compensation, if any, depends on governing law and the facts
90
+ of the matter, not on a self-imposed SEGD rule.
@@ -0,0 +1,5 @@
1
+ include LICENSE
2
+ include README.md
3
+ include LANGUAGE.md
4
+ include LICENSE_GUIDE.md
5
+ include THIRD_PARTY_NOTICES.md
@@ -0,0 +1,134 @@
1
+ Metadata-Version: 2.4
2
+ Name: segd-lang
3
+ Version: 0.1.0
4
+ Summary: Super Easy Game Development - a beginner-friendly language for HTML5 games
5
+ Author: Samiyyan Alam Mridha
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/Samiyyan/SEGD
8
+ Project-URL: Repository, https://github.com/Samiyyan/SEGD
9
+ Project-URL: Documentation, https://github.com/Samiyyan/SEGD/tree/main/docs
10
+ Project-URL: Issues, https://github.com/Samiyyan/SEGD/issues
11
+ Keywords: game-development,programming-language,html5,canvas,beginner
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Topic :: Games/Entertainment
23
+ Classifier: Topic :: Software Development :: Compilers
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Provides-Extra: test
28
+ Requires-Dist: pytest>=9; extra == "test"
29
+ Dynamic: license-file
30
+
31
+ # SEGD
32
+
33
+ <img src="logo.png" alt="SEGD logo" width="180">
34
+
35
+ **SUPER EASY GAME DEVELOPMENT**
36
+
37
+ SEGD is a beginner-friendly programming language for creating 2D HTML5 games. Write a `.segd` file, run it in a browser, and export one folder that can be hosted anywhere.
38
+
39
+ ## Quick start
40
+
41
+ ### Development install
42
+
43
+ ```bash
44
+ python -m pip install -e .
45
+ segd new my-game
46
+ segd run my-game/main.segd
47
+ ```
48
+
49
+ ### PyPI install
50
+
51
+ The PyPI release is not published yet. After it is released, install it with:
52
+
53
+ ```bash
54
+ python -m pip install segd-lang
55
+ ```
56
+
57
+ The installed command remains `segd`.
58
+
59
+ ## Example
60
+
61
+ ```segd
62
+ game title "My First Game"
63
+ game width 960
64
+ game height 540
65
+
66
+ make player hero at 100 100 size 40 40 color "#58a6ff"
67
+ set score to 0
68
+
69
+ on start
70
+ say "Use arrow keys!" at 20 40
71
+
72
+ on update
73
+ if key left is down
74
+ move hero left 5
75
+ if key right is down
76
+ move hero right 5
77
+ ```
78
+
79
+ ## Commands
80
+
81
+ ```bash
82
+ segd new my-game
83
+ segd check my-game/main.segd
84
+ segd run my-game/main.segd
85
+ segd build my-game/main.segd -o build/my-game
86
+ segd version
87
+ segd help
88
+ ```
89
+
90
+ On Windows, use `py -m pip install -e .` and the same `segd` commands.
91
+
92
+ ## Documentation
93
+
94
+ Open [docs/index.html](docs/index.html) locally. The language specification is in [LANGUAGE.md](LANGUAGE.md).
95
+
96
+ ## Visual Studio Code support
97
+
98
+ The repository includes a VS Code extension in [vscode-segd/](/workspaces/SEGD/vscode-segd).
99
+ It provides `.segd` file recognition, an SEGD file icon, real TextMate syntax coloring,
100
+ snippets, command completion suggestions, and hover examples.
101
+
102
+ ## Examples
103
+
104
+ - [Snake](examples/snake/main.segd)
105
+ - [Platformer](examples/platformer/main.segd)
106
+ - [Shooting](examples/shooter/main.segd)
107
+ - [Collecting](examples/collecting/main.segd)
108
+ - [Pong](examples/pong/main.segd)
109
+
110
+ ## Project layout
111
+
112
+ - `segd/compiler` - lexer, parser, AST, semantic analysis, and code generator
113
+ - `segd/runtime` - browser Canvas runtime and HTML5 exporter
114
+ - `docs` - static documentation website
115
+ - `examples` - compilable example games
116
+ - `tests` - automated compiler and export tests
117
+
118
+ ## License and project rights
119
+
120
+ SEGD is open-source software released under the standard [MIT License](LICENSE).
121
+ The copyright notice in that file identifies **Samiyyan Alam Mridha** as the copyright holder.
122
+ Copyright ownership of individual contributions remains with their respective authors subject to the repository license.
123
+
124
+ The MIT License covers the SEGD source and documentation to the extent supplied with the project.
125
+ It does **not** automatically grant ownership or a trademark license for the SEGD project name, brand name, or logo.
126
+ Those rights are not transferred merely by using or redistributing the software.
127
+ See [LICENSE_GUIDE.md](LICENSE_GUIDE.md) for distribution, notice, and compliance guidance.
128
+ Third-party components are identified in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
129
+
130
+ ## Contributing
131
+
132
+ Contributions are welcome under the terms of the MIT License.
133
+ Before submitting a change, read [CONTRIBUTING.md](CONTRIBUTING.md).
134
+ Do not submit licensed material unless you have the right to contribute it and can document its license.
@@ -0,0 +1,104 @@
1
+ # SEGD
2
+
3
+ <img src="logo.png" alt="SEGD logo" width="180">
4
+
5
+ **SUPER EASY GAME DEVELOPMENT**
6
+
7
+ SEGD is a beginner-friendly programming language for creating 2D HTML5 games. Write a `.segd` file, run it in a browser, and export one folder that can be hosted anywhere.
8
+
9
+ ## Quick start
10
+
11
+ ### Development install
12
+
13
+ ```bash
14
+ python -m pip install -e .
15
+ segd new my-game
16
+ segd run my-game/main.segd
17
+ ```
18
+
19
+ ### PyPI install
20
+
21
+ The PyPI release is not published yet. After it is released, install it with:
22
+
23
+ ```bash
24
+ python -m pip install segd-lang
25
+ ```
26
+
27
+ The installed command remains `segd`.
28
+
29
+ ## Example
30
+
31
+ ```segd
32
+ game title "My First Game"
33
+ game width 960
34
+ game height 540
35
+
36
+ make player hero at 100 100 size 40 40 color "#58a6ff"
37
+ set score to 0
38
+
39
+ on start
40
+ say "Use arrow keys!" at 20 40
41
+
42
+ on update
43
+ if key left is down
44
+ move hero left 5
45
+ if key right is down
46
+ move hero right 5
47
+ ```
48
+
49
+ ## Commands
50
+
51
+ ```bash
52
+ segd new my-game
53
+ segd check my-game/main.segd
54
+ segd run my-game/main.segd
55
+ segd build my-game/main.segd -o build/my-game
56
+ segd version
57
+ segd help
58
+ ```
59
+
60
+ On Windows, use `py -m pip install -e .` and the same `segd` commands.
61
+
62
+ ## Documentation
63
+
64
+ Open [docs/index.html](docs/index.html) locally. The language specification is in [LANGUAGE.md](LANGUAGE.md).
65
+
66
+ ## Visual Studio Code support
67
+
68
+ The repository includes a VS Code extension in [vscode-segd/](/workspaces/SEGD/vscode-segd).
69
+ It provides `.segd` file recognition, an SEGD file icon, real TextMate syntax coloring,
70
+ snippets, command completion suggestions, and hover examples.
71
+
72
+ ## Examples
73
+
74
+ - [Snake](examples/snake/main.segd)
75
+ - [Platformer](examples/platformer/main.segd)
76
+ - [Shooting](examples/shooter/main.segd)
77
+ - [Collecting](examples/collecting/main.segd)
78
+ - [Pong](examples/pong/main.segd)
79
+
80
+ ## Project layout
81
+
82
+ - `segd/compiler` - lexer, parser, AST, semantic analysis, and code generator
83
+ - `segd/runtime` - browser Canvas runtime and HTML5 exporter
84
+ - `docs` - static documentation website
85
+ - `examples` - compilable example games
86
+ - `tests` - automated compiler and export tests
87
+
88
+ ## License and project rights
89
+
90
+ SEGD is open-source software released under the standard [MIT License](LICENSE).
91
+ The copyright notice in that file identifies **Samiyyan Alam Mridha** as the copyright holder.
92
+ Copyright ownership of individual contributions remains with their respective authors subject to the repository license.
93
+
94
+ The MIT License covers the SEGD source and documentation to the extent supplied with the project.
95
+ It does **not** automatically grant ownership or a trademark license for the SEGD project name, brand name, or logo.
96
+ Those rights are not transferred merely by using or redistributing the software.
97
+ See [LICENSE_GUIDE.md](LICENSE_GUIDE.md) for distribution, notice, and compliance guidance.
98
+ Third-party components are identified in [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
99
+
100
+ ## Contributing
101
+
102
+ Contributions are welcome under the terms of the MIT License.
103
+ Before submitting a change, read [CONTRIBUTING.md](CONTRIBUTING.md).
104
+ Do not submit licensed material unless you have the right to contribute it and can document its license.
@@ -0,0 +1,59 @@
1
+ # Third-Party Dependency and Asset Notice
2
+
3
+ This audit is a release inventory, not a warranty. Verify licenses before
4
+ redistributing a package or bundle, especially because dependency versions and
5
+ their license metadata can change.
6
+
7
+ ## Project source
8
+
9
+ The SEGD Python and browser source created for this repository is covered by the
10
+ project [MIT License](LICENSE), subject to the copyright and notice requirements
11
+ described there.
12
+
13
+ The MIT License does not make third-party code or assets part of the SEGD
14
+ copyright holder's own work.
15
+
16
+ ## Python dependencies
17
+
18
+ - **setuptools**: declared build-system dependency (`setuptools>=68`) used to
19
+ package SEGD. Setuptools is not MIT source included in the repository. Confirm
20
+ the license of the selected release at build or distribution time.
21
+ - **pytest**: optional development/test dependency. The locally inspected
22
+ pytest 9.2.0 metadata declares MIT. Its development dependency chain may
23
+ include other packages:
24
+ - pluggy 1.7.0: MIT metadata
25
+ - iniconfig 2.3.1: MIT metadata
26
+ - packaging metadata inspected locally: Apache-2.0 OR BSD-2-Clause
27
+ - Pygments metadata inspected locally: BSD-2-Clause
28
+
29
+ The test dependency versions are not currently pinned in `pyproject.toml`,
30
+ and this audit did not verify redistribution copies or all transitive license
31
+ texts. Before a PyPI or packaged release, resolve the environment and include
32
+ the applicable notices required by Apache/BSD license terms.
33
+
34
+ ## Standard-library and browser APIs
35
+
36
+ SEGD uses Python standard-library modules and browser-standard APIs. No third-
37
+ party runtime JavaScript engine or NPM package is currently bundled.
38
+
39
+ ## Bundled assets
40
+
41
+ - `logo.png` and `docs/logo.png` are copies of the same `1024x1024` image data.
42
+ Despite the `.png` extension, local inspection identifies it as JPEG/JFIF.
43
+ The repository has not established a separate provenance or asset license
44
+ record for this image. Treat the logo as project brand artwork, not as
45
+ automatically MIT-licensed material, until authorized in writing and
46
+ accompanied by appropriate documentation.
47
+ - The example games contain source code and generated no bundled sound, image,
48
+ font, or music files. The runtime uses system sans-serif fonts and Canvas.
49
+ - The static documentation contains project-authored HTML and the generated
50
+ files in `docs/` unless a future contribution adds third-party assets.
51
+
52
+ ## Missing or unresolved items
53
+
54
+ 1. Record the source and grant/license for the SEGD logo.
55
+ 2. Pin or lock development dependencies before generating release packages.
56
+ 3. Add complete redistribution notices for any third-party package that a
57
+ release artifact actually bundles.
58
+ 4. If third-party assets or dependencies are later added, update this file and
59
+ add applicable license texts before release.
@@ -0,0 +1,51 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "segd-lang"
7
+ version = "0.1.0"
8
+ description = "Super Easy Game Development - a beginner-friendly language for HTML5 games"
9
+ readme = "README.md"
10
+ requires-python = ">=3.10"
11
+ license = "MIT"
12
+ license-files = ["LICENSE"]
13
+ authors = [{name = "Samiyyan Alam Mridha"}]
14
+ keywords = ["game-development", "programming-language", "html5", "canvas", "beginner"]
15
+ classifiers = [
16
+ "Development Status :: 3 - Alpha",
17
+ "Environment :: Console",
18
+ "Intended Audience :: Developers",
19
+ "Operating System :: OS Independent",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3 :: Only",
22
+ "Programming Language :: Python :: 3.10",
23
+ "Programming Language :: Python :: 3.11",
24
+ "Programming Language :: Python :: 3.12",
25
+ "Programming Language :: Python :: 3.13",
26
+ "Topic :: Games/Entertainment",
27
+ "Topic :: Software Development :: Compilers",
28
+ ]
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/Samiyyan/SEGD"
32
+ Repository = "https://github.com/Samiyyan/SEGD"
33
+ Documentation = "https://github.com/Samiyyan/SEGD/tree/main/docs"
34
+ Issues = "https://github.com/Samiyyan/SEGD/issues"
35
+
36
+ [project.scripts]
37
+ segd = "segd.cli:main"
38
+
39
+ [project.optional-dependencies]
40
+ test = ["pytest>=9"]
41
+
42
+ [tool.setuptools.packages.find]
43
+ where = ["."]
44
+ include = ["segd*"]
45
+ namespaces = true
46
+
47
+ [tool.setuptools.package-data]
48
+ "segd.runtime" = ["runtime.js"]
49
+
50
+ [tool.pytest.ini_options]
51
+ testpaths = ["tests"]
@@ -0,0 +1,8 @@
1
+ """SEGD - Super Easy Game Development."""
2
+
3
+ from .compiler.compiler import compile_source, compile_file
4
+ from .compiler.errors import SEGDCompileError
5
+
6
+ __version__ = "0.1.0"
7
+
8
+ __all__ = ["compile_source", "compile_file", "SEGDCompileError", "__version__"]