You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`Parser::new(UnilangParserOptions::default()) -> Self`: Creates a new parser with default settings.
46
-
*`parser.parse_single_str(&str) -> Result<Vec<GenericInstruction>, ParseError>`: Parses a single, complete command string. **This is the primary method to use for the CLI binary after joining arguments.**
47
+
*`parser.parse_single_instruction(&str) -> Result<GenericInstruction, ParseError>`: Parses a single, complete command string. **This is the primary method to use for the CLI binary after joining arguments.**
47
48
*`parser.parse_slice(&[&str]) -> Result<Vec<GenericInstruction>, ParseError>`: Parses a slice of strings, treating each element as a separate instruction. **Do not use this for CLI arguments from the shell.**
48
49
49
50
***Output Data Structure:**`unilang_instruction_parser::GenericInstruction`
@@ -115,7 +116,7 @@ This section provides the necessary API information for dependencies, as direct
115
116
*Thelegacyparsermustbecompletelyremoved.
116
117
* `CommandDefinition` and `ArgumentDefinition` in `src/data.rs` mustbeupdatedtoincludeallfieldsfromthelatestspecification.
117
118
*The `SemanticAnalyzer` mustberefactoredtoaccept `&[GenericInstruction]` anduse the updated data models.
118
-
*The `unilang_cli` binary must join its command-line arguments into a single string and use `parser.parse_single_str()`.
119
+
*The `unilang_cli` binary must join its command-line arguments into a single string and use `parser.parse_single_instruction()`.
119
120
*All existing tests must be migrated to the new parsing pipeline and must pass.
120
121
121
122
### CrateConformanceCheckProcedure
@@ -138,16 +139,30 @@ This section provides the necessary API information for dependencies, as direct
138
139
139
140
##### Increment 2:RefactorCoreDataModels
140
141
***Goal:**Update the core `CommandDefinition` and `ArgumentDefinition` structs to match the full specification, and adapt the `HelpGenerator` to use the new fields.
142
+
***SpecificationReference:**The fields listed in this increment's steps serve as the specification.
141
143
***Steps:**
142
-
1.In `src/data.rs`, add the following fields to `CommandDefinition`: `namespace:String`, `hint:String`, `status:String`, `version:Option<String>`, `tags:Vec<String>`, `aliases:Vec<String>`, `permissions:Vec<String>`, `idempotent:bool`.
143
-
2.In `src/data.rs`, add the following fields to `ArgumentDefinition`: `hint:String`, `is_default_arg:bool`, `default_value:Option<String>`, `aliases:Vec<String>`, `tags:Vec<String>`, `interactive:bool`, `sensitive:bool`.
144
-
3.Update the `former` derives and any manual constructors for these structs.
145
-
4.In `src/help.rs`, update `HelpGenerator::command` to display information from the new fields (e.g., aliases, status).
144
+
1.Read `module/move/unilang/src/data.rs` and `module/move/unilang/src/help.rs` to get the current implementation.
145
+
2.In `src/data.rs`, modify the `CommandDefinition` struct to add the following public fields: `namespace:String`, `hint:String`, `status:String`, `version:Option<String>`, `tags:Vec<String>`, `aliases:Vec<String>`, `permissions:Vec<String>`, `idempotent:bool`.
146
+
3.In `src/data.rs`, modify the `ArgumentDefinition` struct to add the following public fields: `hint:String`, `is_default_arg:bool`, `default_value:Option<String>`, `aliases:Vec<String>`, `tags:Vec<String>`, `interactive:bool`, `sensitive:bool`.
147
+
4.Ensure the `#[derive(former::Former)]` is present on both structs.The `former` crate will automatically handle the builder pattern for the new public fields.
148
+
5.In `src/help.rs`, update the `HelpGenerator::command` function to incorporate and display information from the new fields.For example, list aliases alongside the command name and display the status and hint.
149
+
6.PerformIncrementVerification.
146
150
***IncrementVerification:**
147
151
1.Execute `cargo build -p unilang` via `execute_command`.The build must succeed.
148
152
***CommitMessage:** "feat(unilang):Update core data models to align with spec v1.3"
149
153
150
-
##### Increment 3:Adapt `SemanticAnalyzer` to NewParser&DataModels
***Goal:**To methodically update all integration tests to use the new parsing pipeline and verify the full system behavior.
177
192
***Steps:**
178
193
1.**FixCoreLogicTestsFirst:**
@@ -188,7 +203,7 @@ This section provides the necessary API information for dependencies, as direct
188
203
1.Execute `timeout 90 cargo test -p unilang --all-targets` via `execute_command`.All tests **must pass**.
189
204
***CommitMessage:** "fix(tests):Migrate all integration tests to the new parsing pipeline"
190
205
191
-
##### Increment6:Finalization
206
+
##### Increment7:Finalization
192
207
***Goal:**Perform a final, holistic review and verification of the entire task's output.
193
208
***Steps:**
194
209
1.Perform a self-critique of all changes against the plan's goal and requirements.
@@ -201,3 +216,8 @@ This section provides the necessary API information for dependencies, as direct
201
216
202
217
### Changelog
203
218
* [Initial] Plan created to unify the parsing architecture by removing the legacy parser, integrating `unilang_instruction_parser`, and updating core data models.
219
+
* [Increment 1] Acknowledged that legacy components were already removed.The plan is now in sync with the codebase.
220
+
* [Increment 2] Modified `data.rs` to add new fields to `CommandDefinition` and `ArgumentDefinition`.
221
+
* [Increment 2] Updated `help.rs` to display new fields from `CommandDefinition`.
222
+
* [Increment 3] Added a focused debugging increment to fix the `parse_single_str` compilation error in `unilang_cli.rs`.
223
+
* [Increment 3] Fixed `parse_single_str` to `parse_single_instruction` and correctly passed the slice to `SemanticAnalyzer::new` in `unilang_cli.rs`.
0 commit comments