Skip to content

Commit 61eb038

Browse files
authored
Merge branch 'mono/dev' into ptree_test
2 parents cb4057e + 0bd639b commit 61eb038

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1630
-2239
lines changed

pkgs/jaml/docs/MEP-0001 [Keywords, Operators, Patterns].md

Lines changed: 16 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ The following identifiers are reserved and **cannot** be used as names for keys,
2828
- **Logical and Boolean Keywords:**
2929
- `true`, `false`, `null`, `is`, `not`, `and`, `or`
3030
- **Control Flow Keywords:**
31-
- `if`, **`elif`**, `else`, `for`, `in`
31+
- `if`, **`elif`**, `else`, `for`, `in`, `enumerate`
3232
- **Directive Keywords:**
3333
- `include`
34-
- **Special Functions:**
34+
- **Reserved Functions:**
3535
- `File()`, `Git()`
3636

3737
#### Keyword Usage
@@ -53,15 +53,15 @@ The following punctuation marks are reserved and **must not** be used as part of
5353
- **Arrow (`->`)** – Reserved for potential functional expressions.
5454
- **Semicolon (`;`)** – Reserved for future extensions.
5555
- **Tilde (`~`)** – Used for load-time expressions.
56-
- **At Symbol (`@`)**Global scope indicator.
57-
- **Dollar Sign (`$`)**Context scope indicator.
58-
- **Percent Sign (`%`)**Self (table-local) scope indicator.
56+
- **At Symbol (`@`)**Reserved for future use.
57+
- **Dollar Sign (`$`)**Reserved for future use.
58+
- **Percent Sign (`%`)**Reserved for future use.
5959
- **Less Than (`<`)** and **Greater Than (`>`)** – Used in comparisons.
6060
- **Exclamation Mark (`!`)** – For negation.
6161
- **Asterisk (`*`)** – For multiplication and comprehensions.
6262
- **Caret (`^`)** – Reserved for future use.
6363
- **Ampersand (`&`)** – Reserved for future use.
64-
- **Pipe (`|`)****Used as a pipeline operator** to chain operations.
64+
- **Pipe (`|`)**Reserved for future use.
6565
- **Forward Slash (`/`)** – In path strings and division.
6666
- **Backslash (`\`)** – As an escape character in strings.
6767

@@ -76,7 +76,6 @@ All bracket types are reserved to ensure unambiguous syntax:
7676
- **Nested Bracket Combinations:**
7777
- Examples: `[{}]`, `{{}}`, `<(>)`, `([)])`, `<{>}`
7878
These are reserved to avoid ambiguity.
79-
- **F-String Brackets (`f"{...}"`)** – For formatted string interpolation.
8079

8180
#### Punctuation Usage
8281
- Any use of reserved punctuation or bracket combinations outside their valid syntax context (or within unquoted identifiers) will raise a syntax error.
@@ -114,11 +113,6 @@ Our markup language supports multiple string delimiters to handle both literal a
114113
```toml
115114
path = `C:\Users\Name`
116115
```
117-
- **F-Strings (`f"..."`):**
118-
For formatted strings with inline variable interpolation.
119-
```toml
120-
configPath = f"${base}/config.toml"
121-
```
122116

123117
#### String Quotation Guidelines
124118
- Mixing different string delimiters in one literal is not allowed.
@@ -150,36 +144,16 @@ Our markup language supports multiple string delimiters to handle both literal a
150144
- **Logical OR:** `or`
151145
- **Logical NOT:** `not`
152146

153-
#### 3.4.4. Pipeline Operator
154-
- Chains operations together in a readable sequence:
155-
```toml
156-
result = ~( data | transform | filter )
157-
```
158-
159-
#### 3.4.5. Conditional (Ternary) Operator
147+
#### 3.4.4. Conditional (Ternary) Operator
160148
- Allows inline conditional expressions:
161149
```toml
162-
status = ~( "Active" if is_active else "Inactive" )
163-
```
164-
165-
#### 3.4.6. String Concatenation and Interpolation
166-
- **Concatenation:** Using the `+` operator.
167-
- **Interpolation:** Via f-string syntax:
168-
```toml
169-
full_path = f"${base}/docs"
150+
status = ~( "Active" if "Active" else "Inactive" )
170151
```
171152

172-
#### 3.4.7. Membership Operators
153+
#### 3.4.5. Membership Operators
173154
- **Membership:** `in`
174155
- **Non-membership:** `not in`
175156

176-
#### 3.4.8. Merge Operator
177-
- Used for table or inline table merging:
178-
```toml
179-
[production]
180-
<< = default_config
181-
```
182-
183157
---
184158

185159
### 3.5. Error Handling
@@ -198,45 +172,37 @@ Our markup language supports multiple string delimiters to handle both literal a
198172

199173
## 4. Examples
200174

201-
### Example 1: Pipeline Operation
202-
203-
```toml
204-
[processing]
205-
output = ~( data | sanitize | format )
206-
```
207-
208-
### Example 2: Valid Use of Reserved Keywords and Conditional Expression
175+
### Example 1: Valid Use of Reserved Keywords and Conditional Expression
209176

210177
```toml
211178
[config]
212179
is_active = true
213-
status = ~( "Running" if is_active else "Stopped" )
180+
status = ~( "Running" if "Active" else "Stopped" )
214181
```
215182

216-
### Example 3: Reserved Function Usage
183+
### Example 2: Reserved Function Usage
217184

218185
```toml
219186
[dependencies]
220187
source = File("requirements.txt")
221188
version = Git("https://repo.git", tag="v1.0")
222189
```
223190

224-
### Example 4: Membership and Merge Operators
191+
### Example 3: Membership
225192

226193
```toml
227194
[settings]
228-
allowed = ~( "admin" in user.roles )
229-
merged_config = default << user_override
195+
allowed = ~( "admin" in ["admin"] )
230196
```
231197

232-
### Example 5: Invalid Use of Reserved Punctuation
198+
### Example 4: Invalid Use of Reserved Punctuation
233199

234200
```toml
235201
[invalid]
236202
some:key = "value" # Syntax error: Colon used incorrectly in key name
237203
```
238204

239-
### Example 6: Invalid Use of Reserved Keyword
205+
### Example 5: Invalid Use of Reserved Keyword
240206

241207
```toml
242208
[config]

pkgs/jaml/docs/MEP-0002 [Precedence].md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ This proposal specifies the precedence rules used by the lexer to recognize and
3030
5. **INTEGER**
3131
6. **BOOLEAN**
3232
7. **NULL**
33-
8. **KEYWORD**
34-
9. **RESERVED_FUNC**
33+
8. **RESERVED_FUNC**
34+
9. **KEYWORD**
3535
10. **TABLE_ARRAY**
3636
11. **TABLE_SECTION**
3737
12. **INLINE_TABLE**

0 commit comments

Comments
 (0)