Function parse_block

Source
pub fn parse_block(symbol: char, input: &str) -> IResult<&str, String>
Expand description

Parse a block from a string.

This function parses block content enclosed in braces with a specific symbol. Braces are used in various contexts within the AIM language for formatting special content.

§Arguments

  • symbol - The expected character after the opening brace
  • input - A string slice containing the block to parse, starting with {

§Returns

  • IResult<&str, String> - A nom result with remaining input and parsed block content

§Examples

use aimx::literals::text::parse_block;
 
assert_eq!(parse_block('$', "{$description}"), Ok(("", "description".to_string())));
assert_eq!(parse_block('@', "{@foo bar 96}"), Ok(("", "foo bar 96".to_string())));