separan 0.1.0a2__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.
- separan-0.1.0a2/LICENSE +201 -0
- separan-0.1.0a2/NOTICE +4 -0
- separan-0.1.0a2/PKG-INFO +354 -0
- separan-0.1.0a2/README.md +310 -0
- separan-0.1.0a2/pyproject.toml +60 -0
- separan-0.1.0a2/reference/separan/__init__.py +8 -0
- separan-0.1.0a2/reference/separan/__main__.py +3 -0
- separan-0.1.0a2/reference/separan/ast_nodes.py +122 -0
- separan-0.1.0a2/reference/separan/ast_printer.py +22 -0
- separan-0.1.0a2/reference/separan/auth.py +175 -0
- separan-0.1.0a2/reference/separan/browser.py +57 -0
- separan-0.1.0a2/reference/separan/builtins.py +786 -0
- separan-0.1.0a2/reference/separan/bytes_ops.py +89 -0
- separan-0.1.0a2/reference/separan/capabilities.py +77 -0
- separan-0.1.0a2/reference/separan/cli.py +55 -0
- separan-0.1.0a2/reference/separan/collection_ops.py +88 -0
- separan-0.1.0a2/reference/separan/cookie_store.py +97 -0
- separan-0.1.0a2/reference/separan/cookies.py +146 -0
- separan-0.1.0a2/reference/separan/database.py +5 -0
- separan-0.1.0a2/reference/separan/db/__init__.py +5 -0
- separan-0.1.0a2/reference/separan/db/core.py +269 -0
- separan-0.1.0a2/reference/separan/db/drivers/__init__.py +1 -0
- separan-0.1.0a2/reference/separan/db/drivers/_dbapi.py +64 -0
- separan-0.1.0a2/reference/separan/db/drivers/mysql.py +46 -0
- separan-0.1.0a2/reference/separan/db/drivers/oracle.py +69 -0
- separan-0.1.0a2/reference/separan/db/drivers/postgresql.py +44 -0
- separan-0.1.0a2/reference/separan/db/drivers/sqlite.py +98 -0
- separan-0.1.0a2/reference/separan/db/drivers/sqlserver.py +97 -0
- separan-0.1.0a2/reference/separan/db/errors.py +20 -0
- separan-0.1.0a2/reference/separan/db/registry.py +23 -0
- separan-0.1.0a2/reference/separan/errors.py +40 -0
- separan-0.1.0a2/reference/separan/http_client.py +220 -0
- separan-0.1.0a2/reference/separan/http_server.py +208 -0
- separan-0.1.0a2/reference/separan/interpreter.py +572 -0
- separan-0.1.0a2/reference/separan/io_json.py +194 -0
- separan-0.1.0a2/reference/separan/lexer.py +145 -0
- separan-0.1.0a2/reference/separan/list_ops.py +197 -0
- separan-0.1.0a2/reference/separan/lsp.py +382 -0
- separan-0.1.0a2/reference/separan/lsp_analysis.py +222 -0
- separan-0.1.0a2/reference/separan/objects.py +52 -0
- separan-0.1.0a2/reference/separan/parser.py +408 -0
- separan-0.1.0a2/reference/separan/processes.py +118 -0
- separan-0.1.0a2/reference/separan/randomness.py +106 -0
- separan-0.1.0a2/reference/separan/structural.py +303 -0
- separan-0.1.0a2/reference/separan/structure_insights.py +139 -0
- separan-0.1.0a2/reference/separan/system_context.py +54 -0
- separan-0.1.0a2/reference/separan/system_utilities.py +201 -0
- separan-0.1.0a2/reference/separan/temporal.py +263 -0
- separan-0.1.0a2/reference/separan/token.py +95 -0
- separan-0.1.0a2/reference/separan.egg-info/PKG-INFO +354 -0
- separan-0.1.0a2/reference/separan.egg-info/SOURCES.txt +83 -0
- separan-0.1.0a2/reference/separan.egg-info/dependency_links.txt +1 -0
- separan-0.1.0a2/reference/separan.egg-info/entry_points.txt +4 -0
- separan-0.1.0a2/reference/separan.egg-info/requires.txt +21 -0
- separan-0.1.0a2/reference/separan.egg-info/top_level.txt +1 -0
- separan-0.1.0a2/setup.cfg +4 -0
- separan-0.1.0a2/tests/test_auth.py +102 -0
- separan-0.1.0a2/tests/test_browser_boundary.py +25 -0
- separan-0.1.0a2/tests/test_builtins.py +106 -0
- separan-0.1.0a2/tests/test_bytes_builtins.py +55 -0
- separan-0.1.0a2/tests/test_collection_math_builtins.py +164 -0
- separan-0.1.0a2/tests/test_const.py +67 -0
- separan-0.1.0a2/tests/test_cookie_store.py +75 -0
- separan-0.1.0a2/tests/test_cookies.py +93 -0
- separan-0.1.0a2/tests/test_database.py +229 -0
- separan-0.1.0a2/tests/test_error_handling.py +104 -0
- separan-0.1.0a2/tests/test_http_client.py +89 -0
- separan-0.1.0a2/tests/test_http_server.py +86 -0
- separan-0.1.0a2/tests/test_imports.py +50 -0
- separan-0.1.0a2/tests/test_io_json_capabilities.py +124 -0
- separan-0.1.0a2/tests/test_language_edges.py +156 -0
- separan-0.1.0a2/tests/test_list_builtins.py +114 -0
- separan-0.1.0a2/tests/test_lsp.py +225 -0
- separan-0.1.0a2/tests/test_object_blocks.py +57 -0
- separan-0.1.0a2/tests/test_operators.py +90 -0
- separan-0.1.0a2/tests/test_process_execution.py +79 -0
- separan-0.1.0a2/tests/test_random_builtins.py +131 -0
- separan-0.1.0a2/tests/test_separan.py +121 -0
- separan-0.1.0a2/tests/test_sorting.py +121 -0
- separan-0.1.0a2/tests/test_string_builtins.py +123 -0
- separan-0.1.0a2/tests/test_structural.py +116 -0
- separan-0.1.0a2/tests/test_structure_insights.py +50 -0
- separan-0.1.0a2/tests/test_system_context.py +56 -0
- separan-0.1.0a2/tests/test_system_utilities.py +88 -0
- separan-0.1.0a2/tests/test_temporal.py +208 -0
separan-0.1.0a2/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
separan-0.1.0a2/NOTICE
ADDED
separan-0.1.0a2/PKG-INFO
ADDED
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: separan
|
|
3
|
+
Version: 0.1.0a2
|
|
4
|
+
Summary: Python reference interpreter for the label-structured Separan language
|
|
5
|
+
Author: Separan contributors
|
|
6
|
+
License-Expression: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/mocchii2/Separan
|
|
8
|
+
Project-URL: Documentation, https://github.com/mocchii2/Separan/tree/main/spec
|
|
9
|
+
Project-URL: Repository, https://github.com/mocchii2/Separan.git
|
|
10
|
+
Project-URL: Issues, https://github.com/mocchii2/Separan/issues
|
|
11
|
+
Project-URL: VS Code Marketplace, https://marketplace.visualstudio.com/items?itemName=separan.separan-language
|
|
12
|
+
Keywords: programming-language,scripting-language,interpreter,ai-coding,language-design
|
|
13
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
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 :: Software Development :: Interpreters
|
|
23
|
+
Requires-Python: >=3.10
|
|
24
|
+
Description-Content-Type: text/markdown
|
|
25
|
+
License-File: LICENSE
|
|
26
|
+
License-File: NOTICE
|
|
27
|
+
Requires-Dist: tzdata>=2025.2
|
|
28
|
+
Requires-Dist: cryptography<51,>=45
|
|
29
|
+
Requires-Dist: argon2-cffi<26,>=23
|
|
30
|
+
Provides-Extra: postgresql
|
|
31
|
+
Requires-Dist: psycopg[binary]<4,>=3.2; extra == "postgresql"
|
|
32
|
+
Provides-Extra: mysql
|
|
33
|
+
Requires-Dist: mysql-connector-python<10,>=9; extra == "mysql"
|
|
34
|
+
Provides-Extra: oracle
|
|
35
|
+
Requires-Dist: oracledb<5,>=3; extra == "oracle"
|
|
36
|
+
Provides-Extra: sqlserver
|
|
37
|
+
Requires-Dist: pyodbc<6,>=5; extra == "sqlserver"
|
|
38
|
+
Provides-Extra: db-all
|
|
39
|
+
Requires-Dist: psycopg[binary]<4,>=3.2; extra == "db-all"
|
|
40
|
+
Requires-Dist: mysql-connector-python<10,>=9; extra == "db-all"
|
|
41
|
+
Requires-Dist: oracledb<5,>=3; extra == "db-all"
|
|
42
|
+
Requires-Dist: pyodbc<6,>=5; extra == "db-all"
|
|
43
|
+
Dynamic: license-file
|
|
44
|
+
|
|
45
|
+
<p align="center">
|
|
46
|
+
<img src="https://raw.githubusercontent.com/mocchii2/Separan/main/logo/separan_logo.png" alt="Separan" width="720">
|
|
47
|
+
</p>
|
|
48
|
+
|
|
49
|
+
# Separan
|
|
50
|
+
|
|
51
|
+
> **Structure should be named, not guessed.**
|
|
52
|
+
>
|
|
53
|
+
> Free programmers from indentation and bracket ambiguity.
|
|
54
|
+
|
|
55
|
+
> **AI may write the code. Humans still need to understand it.**
|
|
56
|
+
|
|
57
|
+
[日本語](https://github.com/mocchii2/Separan/blob/main/docs/README.ja.md) | English
|
|
58
|
+
|
|
59
|
+
[](https://pypi.org/project/separan/)
|
|
60
|
+
[](https://marketplace.visualstudio.com/items?itemName=separan.separan-language)
|
|
61
|
+
|
|
62
|
+
Separan makes AI-written code easier for people to read, understand, and
|
|
63
|
+
review. Labels turn otherwise anonymous control flow into visible intent:
|
|
64
|
+
`:validate_payment`, `:write_audit_log`, and `:retry_connection` become part of
|
|
65
|
+
the program's checked structure. A reviewer can understand what a block is for,
|
|
66
|
+
navigate its exact boundary, and verify where an AI made changes without first
|
|
67
|
+
reconstructing indentation or counting brackets.
|
|
68
|
+
|
|
69
|
+
This is not only about restricting AI. It is about making generated code
|
|
70
|
+
explain its structure to the human who remains responsible for it.
|
|
71
|
+
|
|
72
|
+
## Run it in 30 seconds
|
|
73
|
+
|
|
74
|
+
```console
|
|
75
|
+
git clone https://github.com/mocchii2/Separan.git && cd Separan
|
|
76
|
+
python -m pip install separan
|
|
77
|
+
separan examples/hello.sep
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Python 3.10 or newer is required.
|
|
81
|
+
|
|
82
|
+
## Try it in five minutes
|
|
83
|
+
|
|
84
|
+
First, run a valid labeled block:
|
|
85
|
+
|
|
86
|
+
```separan
|
|
87
|
+
if true :check
|
|
88
|
+
print "ok"
|
|
89
|
+
endif:check
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Then run the intentionally broken example:
|
|
93
|
+
|
|
94
|
+
```console
|
|
95
|
+
python -m separan examples/label_mismatch.sep
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The closer names a different structure:
|
|
99
|
+
|
|
100
|
+
```separan
|
|
101
|
+
if true :check
|
|
102
|
+
print "ok"
|
|
103
|
+
endif:wrong
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Separan points to the structural mistake and tells you the exact closer it
|
|
107
|
+
expected:
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
SEPARAN E104: Block label mismatch
|
|
111
|
+
|
|
112
|
+
Expected:
|
|
113
|
+
endif:check
|
|
114
|
+
|
|
115
|
+
Actual:
|
|
116
|
+
endif:wrong
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
That diagnostic is the language in miniature: structure is named and verified,
|
|
120
|
+
not inferred from indentation or bracket counting.
|
|
121
|
+
|
|
122
|
+
Separan is a label-structured scripting language designed for code that humans,
|
|
123
|
+
AI systems, and development tools can inspect without guessing where a block
|
|
124
|
+
ends. Indentation is decoration. Every block carries an explicit identity, and
|
|
125
|
+
its opener and closer must agree.
|
|
126
|
+
|
|
127
|
+
```separan
|
|
128
|
+
function:main
|
|
129
|
+
name = "Separan"
|
|
130
|
+
|
|
131
|
+
if name != null :名前あり
|
|
132
|
+
print "Hello, " + name
|
|
133
|
+
endif:名前あり
|
|
134
|
+
|
|
135
|
+
end_function:main
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Block and multiline-comment labels accept NFC-normalized Unicode identifiers.
|
|
139
|
+
Program identifiers such as variables and function names remain ASCII-only.
|
|
140
|
+
|
|
141
|
+
Separan rejects structural mistakes before they can silently succeed:
|
|
142
|
+
|
|
143
|
+
```separan
|
|
144
|
+
if user.active :active_user
|
|
145
|
+
print "active"
|
|
146
|
+
endif:admin_user
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
```text
|
|
150
|
+
SEPARAN E104: Block label mismatch
|
|
151
|
+
|
|
152
|
+
Expected:
|
|
153
|
+
endif:active_user
|
|
154
|
+
|
|
155
|
+
Actual:
|
|
156
|
+
endif:admin_user
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## The 30-second demo
|
|
160
|
+
|
|
161
|
+
Separan gives a meaningful name to the structure an AI is allowed to edit:
|
|
162
|
+
|
|
163
|
+
```separan
|
|
164
|
+
if user.active :active_user
|
|
165
|
+
print "active user"
|
|
166
|
+
endif:active_user
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Give the AI a structural instruction instead of a line-number range:
|
|
170
|
+
|
|
171
|
+
```text
|
|
172
|
+
Modify only Separan scope function:main#1/if:active_user#1
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
The parser verifies that the opening and closing structure agree. The v0.4
|
|
176
|
+
review tool extends that identity to the diff boundary:
|
|
177
|
+
|
|
178
|
+
```text
|
|
179
|
+
PASS: AI edit scope verified.
|
|
180
|
+
Allowed changes 1, violations 0
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The label is simultaneously human documentation, parser-checked structure, and
|
|
184
|
+
a machine-verifiable edit boundary.
|
|
185
|
+
|
|
186
|
+
```console
|
|
187
|
+
separan-structure diff before.sep after.sep
|
|
188
|
+
separan-structure verify before.sep after.sep --allow active_user
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Use `--json` for CI and review bots. The VS Code v0.4 extension can compare the
|
|
192
|
+
active file against Git `HEAD` and verify the label under the cursor. See the
|
|
193
|
+
[structural AI workflow](https://github.com/mocchii2/Separan/blob/main/spec/structural-ai.md).
|
|
194
|
+
|
|
195
|
+
## v0.1.0-alpha.2
|
|
196
|
+
|
|
197
|
+
The current Python reference implementation includes strict label validation,
|
|
198
|
+
detailed diagnostics, fixed inferred types, homogeneous lists, functions,
|
|
199
|
+
`main` auto-start, conditionals, loops, comments, and AST output. The v0.4
|
|
200
|
+
tooling layer adds a dependency-free LSP, rich VS Code support, structural
|
|
201
|
+
diffs, and enforced AI edit scopes without changing v0.1 language semantics.
|
|
202
|
+
|
|
203
|
+
The standard library now covers explicit type conversion, Unicode string and
|
|
204
|
+
homogeneous-list processing, immutable bytes, datetime and duration values,
|
|
205
|
+
reproducible and secure randomness, filesystem and process utilities, HTTP
|
|
206
|
+
client/server previews, authentication, cookies, and parameter-bound SQLite.
|
|
207
|
+
Built-ins use the same strict argument and type diagnostics as user-defined
|
|
208
|
+
functions; implicit coercion remains forbidden.
|
|
209
|
+
|
|
210
|
+
Higher-order collection processing uses explicit `function` values:
|
|
211
|
+
`map`, `filter`, and initial-value-required `reduce` preserve strict callback
|
|
212
|
+
contracts. One-level `flatten`, `sum`, `average`, and value `count` complete the
|
|
213
|
+
core aggregates. Math includes finite real trigonometric, logarithmic, and
|
|
214
|
+
exponential functions with domain errors instead of NaN/Infinity results.
|
|
215
|
+
|
|
216
|
+
String processing includes `trim`, `upper`, `lower`, `contains`, `starts_with`,
|
|
217
|
+
`ends_with`, `split`, `join`, `replace`, code-point-based `substring`/`char_at`,
|
|
218
|
+
non-overlapping literal `find_all`, and a string/list-shared `reverse`.
|
|
219
|
+
|
|
220
|
+
The experimental temporal implementation provides distinct `datetime`,
|
|
221
|
+
`local_datetime`, `timezone`, and `duration` values. It requires explicit zones,
|
|
222
|
+
rejects ambiguous DST wall times, and keeps Unix units visible in function names.
|
|
223
|
+
Run `separan --timezone-version` to inspect the active timezone database.
|
|
224
|
+
|
|
225
|
+
Randomness is split by purpose: seeded `random_*` functions use a reproducible
|
|
226
|
+
language-defined PCG32 stream, while `secure_random_*` functions use the
|
|
227
|
+
operating system's cryptographic source. Secure bytes have a distinct `bytes`
|
|
228
|
+
type rather than masquerading as a number list.
|
|
229
|
+
|
|
230
|
+
Binary values are immutable and never convert to strings implicitly. Explicit
|
|
231
|
+
UTF encodings, strict hex/Base64 codecs, slicing, byte lookup, and binary
|
|
232
|
+
concatenation are available in the reference preview.
|
|
233
|
+
|
|
234
|
+
Authentication uses high-level primitives rather than user-built cryptography.
|
|
235
|
+
Host-provided secrets are a distinct automatically redacted type; HTTP auth,
|
|
236
|
+
OAuth client credentials, HMAC-SHA256, HS256 JWT, and scrypt password hashing
|
|
237
|
+
have experimental reference implementations.
|
|
238
|
+
|
|
239
|
+
HTTP supports one-shot cookies and explicit stateful Cookie Jars. Cookie values,
|
|
240
|
+
jar display, and received response cookies are redacted; domain, path, expiry,
|
|
241
|
+
and Secure attributes control transmission.
|
|
242
|
+
|
|
243
|
+
Lists are homogeneous and zero-based. Operations such as `list_append`,
|
|
244
|
+
`list_remove`, `slice`, `reverse`, and every sort return new lists; v0.1 exposes
|
|
245
|
+
no mutating collection API. Stable sorting includes descending, Unicode
|
|
246
|
+
case-folded, natural-number, and object-field variants. See the
|
|
247
|
+
[list specification](https://github.com/mocchii2/Separan/blob/main/spec/lists.md).
|
|
248
|
+
|
|
249
|
+
`length(value)` and `is_empty(value)` work consistently across strings, lists,
|
|
250
|
+
and bytes. String search, repetition, and padding operate on Unicode code points;
|
|
251
|
+
failed `index_of` and `last_index_of` searches return null.
|
|
252
|
+
|
|
253
|
+
`const name = value` creates an immutable binding while ordinary assignment
|
|
254
|
+
remains mutable. Labeled object/list data blocks, namespaced imports,
|
|
255
|
+
capability-based I/O, explicit JSON boundary conversion, and labeled
|
|
256
|
+
`try`/`catch`/`finally` handling are all available experimentally in the
|
|
257
|
+
reference interpreter.
|
|
258
|
+
|
|
259
|
+
The accepted HTTP design keeps `http_get` lightweight and puts detailed status,
|
|
260
|
+
headers, and bytes in `http_request`. It explicitly does not impersonate a
|
|
261
|
+
browser: JavaScript, DOM, viewport, and navigator state belong to a future
|
|
262
|
+
`browser_open` subsystem.
|
|
263
|
+
The reference preview implements both APIs behind an explicit network
|
|
264
|
+
capability with host, scheme, port, redirect, timeout, and body-size checks.
|
|
265
|
+
Labeled HTTP routes and a separately capability-gated development host are also
|
|
266
|
+
available as a server preview. The dispatcher is transport-independent so a
|
|
267
|
+
future Lambda or production adapter can reuse the same `.sep` application.
|
|
268
|
+
The database preview separates its common API from official SQLite, PostgreSQL,
|
|
269
|
+
MySQL, Oracle, and Microsoft SQL Server adapters. SQLite is built in; the other
|
|
270
|
+
four are optional extras. Safe `?` placeholder scanning, strict single-row and scalar APIs,
|
|
271
|
+
labeled transactions, common metadata, and redacted connections are available.
|
|
272
|
+
Stable execution metadata is available through the reserved read-only `system`
|
|
273
|
+
context; dynamic values such as time, requests, randomness, and database state
|
|
274
|
+
remain explicit functions or scoped values.
|
|
275
|
+
|
|
276
|
+
The v0.5 Structure Explorer turns the active `.sep` file into a navigable block
|
|
277
|
+
tree. Each named structure shows its direct parameters, reads, writes, and
|
|
278
|
+
calls, plus added/modified/removed state against Git `HEAD`. Selecting a block
|
|
279
|
+
jumps to its opener; moving the cursor tracks the deepest enclosing scope. The
|
|
280
|
+
analysis is parser-backed and never executes the program. See the
|
|
281
|
+
[Structure Explorer specification](https://github.com/mocchii2/Separan/blob/main/spec/structure-explorer.md).
|
|
282
|
+
|
|
283
|
+
The Language Server preview is available as `separan-lsp`. It provides parser
|
|
284
|
+
and simple fixed-type diagnostics, mismatch Quick Fixes, typed Semantic Tokens,
|
|
285
|
+
Hover, definition, scope-safe label rename, matching highlights, completion,
|
|
286
|
+
signature help, inlay hints, labeled symbols/folding, and AST-preserving
|
|
287
|
+
formatting. See the [VS Code/LSP specification](https://github.com/mocchii2/Separan/blob/main/spec/vscode-extension.md).
|
|
288
|
+
|
|
289
|
+
The strict operator set includes power, integer floor division, null fallback,
|
|
290
|
+
compound assignment, and typed membership. See
|
|
291
|
+
[`examples/operators.sep`](https://github.com/mocchii2/Separan/blob/main/examples/operators.sep) and the
|
|
292
|
+
[language specification](https://github.com/mocchii2/Separan/blob/main/spec/README.md#operators).
|
|
293
|
+
|
|
294
|
+
External commands follow the same explicitness rule: `exec` passes a program and
|
|
295
|
+
argv directly, `exec_checked` turns nonzero exit into a catchable error, and the
|
|
296
|
+
separately gated `shell_exec` is the only API that interprets shell syntax.
|
|
297
|
+
These process APIs now have an experimental capability-gated implementation.
|
|
298
|
+
|
|
299
|
+
The utility implementation provides versioned Unicode regexes, deterministic
|
|
300
|
+
capability-gated `glob`, process-scoped environment access, and command-line
|
|
301
|
+
helpers that keep `script_path()` separate from `command_args()`.
|
|
302
|
+
An experimental implementation of these APIs and named function arguments is
|
|
303
|
+
available in the reference interpreter.
|
|
304
|
+
|
|
305
|
+
Labeled `object:name` and `list:name` data blocks, `user.name` member access,
|
|
306
|
+
namespaced imports, and labeled `try`/`catch`/`finally`/`throw` also have
|
|
307
|
+
experimental reference implementations.
|
|
308
|
+
|
|
309
|
+
```console
|
|
310
|
+
python -m pip install -e .
|
|
311
|
+
separan examples/hello.sep
|
|
312
|
+
separan --ast examples/if.sep
|
|
313
|
+
python -m unittest discover -s tests -v
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Python 3.10 or newer is required.
|
|
317
|
+
|
|
318
|
+
## Repository
|
|
319
|
+
|
|
320
|
+
```text
|
|
321
|
+
Separan/
|
|
322
|
+
├─ spec/ Language specification
|
|
323
|
+
├─ reference/ Python reference implementation
|
|
324
|
+
├─ tests/ Conformance and diagnostic tests
|
|
325
|
+
├─ examples/ .sep programs
|
|
326
|
+
├─ vscode/ VS Code extension
|
|
327
|
+
├─ docs/ Philosophy and AI integration
|
|
328
|
+
├─ logo/ Official Separan logo and mark
|
|
329
|
+
├─ ROADMAP.md
|
|
330
|
+
└─ LICENSE
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
Brand assets are available as the full [Separan logo](https://github.com/mocchii2/Separan/blob/main/logo/separan_logo.png)
|
|
334
|
+
and square [Separan mark](https://github.com/mocchii2/Separan/blob/main/logo/separan_mark.png). The original PNG files are
|
|
335
|
+
kept unchanged in the repository. A separately optimized 128px derivative is
|
|
336
|
+
used as the [VS Code extension icon](https://github.com/mocchii2/Separan/blob/main/vscode/images/icon.png).
|
|
337
|
+
|
|
338
|
+
Read the [language specification](https://github.com/mocchii2/Separan/blob/main/spec/README.md), the [design philosophy](https://github.com/mocchii2/Separan/blob/main/docs/philosophy.md),
|
|
339
|
+
the [AI integration model](https://github.com/mocchii2/Separan/blob/main/docs/ai-integration.md), the
|
|
340
|
+
[temporal-type specification](https://github.com/mocchii2/Separan/blob/main/spec/temporal-types.md), and the [roadmap](https://github.com/mocchii2/Separan/blob/main/ROADMAP.md).
|
|
341
|
+
The experimental [database standard](https://github.com/mocchii2/Separan/blob/main/spec/database.md) documents the common API
|
|
342
|
+
and official SQLite, PostgreSQL, MySQL, Oracle, and SQL Server adapters.
|
|
343
|
+
The [reserved system context](https://github.com/mocchii2/Separan/blob/main/spec/system-context.md) defines normalized,
|
|
344
|
+
read-only execution metadata and its namespace boundary.
|
|
345
|
+
|
|
346
|
+
## Status
|
|
347
|
+
|
|
348
|
+
Separan is experimental software at **v0.1.0-alpha.2**. The syntax and diagnostics
|
|
349
|
+
may change before v1.0. It is ready for exploration, not production use.
|
|
350
|
+
|
|
351
|
+
## License
|
|
352
|
+
|
|
353
|
+
Separan is licensed under the [Apache License 2.0](https://github.com/mocchii2/Separan/blob/main/LICENSE). See [NOTICE](https://github.com/mocchii2/Separan/blob/main/NOTICE)
|
|
354
|
+
for attribution information.
|