2 unstable releases
0.2.0 | Jul 23, 2025 |
---|---|
0.1.0 | Jul 20, 2025 |
#2708 in Parser implementations
44 downloads per month
335KB
5.5K
SLoC
unilang_instruction_parser
Alias crate for unilang_parser
. Re-exports unilang_parser
for backward compatibility.
overview
This crate serves as a compatibility alias for the core unilang_parser
library, which provides syntactic analysis for CLI-like instruction strings within the Unilang Framework. It enables parsing of command strings into structured GenericInstruction
objects.
key_features
- command_path_parsing: Multi-segment command paths (
namespace.command
) - argument_processing: Both positional and named arguments (
key::value
) - quoting_support: Single and double quotes with escape sequences
- help_operator: Built-in
?
help request handling - multiple_instructions: Sequence parsing with
;;
separator - robust_error_reporting: Detailed parse errors with source locations
usage
use unilang_instruction_parser::{Parser, UnilangParserOptions};
let parser = Parser::new(UnilangParserOptions::default());
let input = "log.level severity::debug message::'Hello World!'";
match parser.parse_single_instruction(input) {
Ok(instruction) => {
println!("Command: {:?}", instruction.command_path_slices);
println!("Named args: {:?}", instruction.named_arguments);
},
Err(e) => eprintln!("Parse error: {}", e),
}
migration_notice
This is an alias crate that re-exports unilang_parser
. For new projects, consider using unilang_parser
directly. This crate exists to maintain backward compatibility for existing code.
documentation
For complete documentation and examples, see:
license
MIT License. See LICENSE file for details.
Dependencies
~0.7–1.2MB
~24K SLoC