Struct flexi_parse::group::Group
source · pub struct Group<D: Delimiters> { /* private fields */ }
Expand description
A delimited group.
For more information, see the module documentation.
Implementations§
source§impl<D: Delimiters> Group<D>
impl<D: Delimiters> Group<D>
sourcepub fn into_token_stream(self) -> TokenStream
pub fn into_token_stream(self) -> TokenStream
Returns the contained TokenStream
.
Examples found in repository?
examples/calc.rs (line 90)
82 83 84 85 86 87 88 89 90 91 92 93 94
fn primary(input: ParseStream<'_>) -> Result<Expr> {
let lookahead = input.lookahead();
if lookahead.peek(token::LitFloat) {
Ok(Expr::Num(input.parse::<token::LitFloat>()?.value()))
} else if lookahead.peek(token::LitInt) {
Ok(Expr::Num(input.parse::<token::LitInt>()?.value() as f64))
} else if lookahead.peek(token::LeftParen) {
let group: Group<Parentheses> = input.parse()?;
parse(group.into_token_stream())
} else {
Err(lookahead.error())
}
}
More examples
examples/lox/main.rs (line 360)
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670
fn finish_call(input: ParseStream<'_>, callee: Expr) -> Result<Self> {
let mut contents: Group<Parentheses> = input.parse()?;
contents.remove_whitespace();
let paren = contents.delimiters();
let arguments: Punctuated<Expr, Punct![","]> =
Punctuated::parse_separated_trailing.parse(contents.into_token_stream())?;
let arguments: Vec<_> = arguments.into_iter().collect();
if arguments.len() >= 255 {
input.add_error(input.new_error(
"Can't have more than 254 arguments".to_string(),
paren.0.clone(),
error_codes::TOO_MANY_ARGS,
));
}
Ok(Expr::Call {
callee: Box::new(callee),
paren,
arguments,
})
}
fn primary(input: ParseStream<'_>) -> Result<Self> {
let lookahead = input.lookahead();
if lookahead.peek(kw::keyword_false) {
Ok(Expr::Literal(Literal::False(input.parse()?)))
} else if lookahead.peek(kw::keyword_true) {
Ok(Expr::Literal(Literal::True(input.parse()?)))
} else if lookahead.peek(kw::keyword_nil) {
Ok(Expr::Literal(Literal::Nil(input.parse()?)))
} else if lookahead.peek(LitFloat) {
Ok(Expr::Literal(Literal::Float(input.parse()?)))
} else if lookahead.peek(LitInt) {
Ok(Expr::Literal(Literal::Int(input.parse()?)))
} else if lookahead.peek(LitStr) {
Ok(Expr::Literal(Literal::String(input.parse()?)))
} else if input.peek(kw::keyword_super) {
Ok(Expr::Super {
keyword: input.parse()?,
distance: Cell::new(None),
dot: input.parse()?,
method: input.parse()?,
})
} else if input.peek(kw::keyword_this) {
Ok(Expr::This {
keyword: input.parse()?,
distance: Cell::new(None),
})
} else if lookahead.peek(Ident) {
Ok(Expr::Variable {
name: kw::ident(input)?,
distance: Cell::new(None),
})
} else if lookahead.peek(Punct!["("]) {
let group: Group<Parentheses> = input.parse()?;
Ok(Expr::Group(Box::new(parse(group.into_token_stream())?)))
} else {
Err(lookahead.error())
}
}
}
impl Parse for Expr {
fn parse(input: ParseStream<'_>) -> Result<Self> {
Expr::assignment(input)
}
}
#[derive(Debug, Clone, PartialEq)]
struct Function {
name: Ident,
params: Vec<Ident>,
body: Vec<Stmt>,
}
impl Parse for Function {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let name: Ident = input.parse()?;
let mut contents: Group<Parentheses> = input.parse()?;
contents.remove_whitespace();
let Parentheses(span) = contents.delimiters();
let tokens = contents.into_token_stream();
let params: Vec<Ident> = if tokens.is_empty() {
vec![]
} else {
let params: Punctuated<Ident, Punct![","]> =
Punctuated::parse_separated.parse(tokens)?;
params.into_iter().collect()
};
if params.len() >= 255 {
input.add_error(input.new_error(
"Can't have more than 254 parameters".to_string(),
span,
error_codes::TOO_MANY_ARGS,
));
}
let mut contents: Group<Braces> = input.parse()?;
contents.remove_whitespace();
let body = block.parse(contents.into_token_stream())?;
Ok(Function { name, params, body })
}
}
#[derive(Debug, Clone, PartialEq)]
enum Stmt {
Block(Vec<Stmt>),
Class {
name: Ident,
superclass: Option<Ident>,
superclass_distance: Cell<Option<usize>>,
methods: Vec<Function>,
},
Expr(Expr),
Function(Function),
If {
condition: Expr,
then_branch: Box<Stmt>,
else_branch: Option<Box<Stmt>>,
},
Print(Expr),
Return {
keyword: kw::keyword_return,
value: Option<Expr>,
},
Variable {
name: Ident,
initialiser: Option<Expr>,
},
While {
condition: Expr,
body: Box<Stmt>,
},
}
fn block(input: ParseStream<'_>) -> Result<Vec<Stmt>> {
let mut statements = vec![];
while !input.is_empty() {
statements.push(Stmt::declaration(input)?);
}
Ok(statements)
}
impl Stmt {
fn declaration(input: ParseStream<'_>) -> Result<Self> {
if input.peek(kw::keyword_class) {
Stmt::class_declaration(input)
} else if input.peek(kw::keyword_fun) {
let _: kw::keyword_fun = input.parse()?;
Ok(Stmt::Function(Function::parse(input)?))
} else if input.peek(kw::keyword_var) {
Stmt::var_declaration(input)
} else {
Stmt::statement(input)
}
}
fn class_declaration(input: ParseStream<'_>) -> Result<Self> {
let _: kw::keyword_class = input.parse()?;
let name: Ident = input.parse()?;
let superclass = if input.peek(Punct!["<"]) {
let _: Punct!["<"] = input.parse()?;
Some(input.parse()?)
} else {
None
};
let mut contents: Group<Braces> = input.parse()?;
contents.remove_whitespace();
let methods = parse_repeated.parse(contents.into_token_stream())?;
Ok(Stmt::Class {
name,
superclass,
superclass_distance: Cell::new(None),
methods,
})
}
fn var_declaration(input: ParseStream<'_>) -> Result<Self> {
let _: kw::keyword_var = input.parse()?;
let name = kw::ident(input)?;
let initialiser = if input.peek(Punct!["="]) {
let _: Punct!["="] = input.parse()?;
Some(input.parse()?)
} else {
None
};
let _: Punct![";"] = input.parse()?;
Ok(Stmt::Variable { name, initialiser })
}
fn statement(input: ParseStream<'_>) -> Result<Self> {
if input.peek(kw::keyword_if) {
Stmt::if_statement(input)
} else if input.peek(kw::keyword_for) {
Stmt::for_statement(input)
} else if input.peek(kw::keyword_print) {
Stmt::print_statement(input)
} else if input.peek(kw::keyword_return) {
Stmt::return_statement(input)
} else if input.peek(kw::keyword_while) {
Stmt::while_statement(input)
} else if input.peek(Punct!["{"]) {
let mut group: Group<Braces> = input.parse()?;
group.remove_whitespace();
Ok(Stmt::Block(block.parse(group.into_token_stream())?))
} else {
Stmt::expression_statement(input)
}
}
fn for_statement(input: ParseStream<'_>) -> Result<Self> {
struct ForInner(Option<Stmt>, Expr, Option<Expr>);
impl Parse for ForInner {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let initialiser = if input.peek(Punct![";"]) {
let _: Punct![";"] = input.parse()?;
None
} else if input.peek(kw::keyword_var) {
Some(Stmt::var_declaration(input)?)
} else {
Some(Stmt::expression_statement(input)?)
};
let condition = if input.peek(Punct![";"]) {
Expr::Literal(Literal::True(kw::keyword_true::new(input)))
} else {
Expr::parse(input)?
};
let _: Punct![";"] = input.parse()?;
let increment = if input.is_empty() {
None
} else {
Some(Expr::parse(input)?)
};
Ok(ForInner(initialiser, condition, increment))
}
}
let _: kw::keyword_for = input.parse()?;
let mut inner: Group<Parentheses> = input.parse()?;
inner.remove_whitespace();
let ForInner(initialiser, condition, increment) = parse(inner.into_token_stream())?;
let mut body = Stmt::statement(input)?;
if let Some(increment) = increment {
body = Stmt::Block(vec![body, Stmt::Expr(increment)]);
}
body = Stmt::While {
condition,
body: Box::new(body),
};
if let Some(initialiser) = initialiser {
body = Stmt::Block(vec![initialiser, body]);
}
Ok(body)
}
fn if_statement(input: ParseStream<'_>) -> Result<Self> {
let _: kw::keyword_if = input.parse()?;
let condition: Group<Parentheses> = input.parse()?;
let condition = parse(condition.into_token_stream())?;
let then_branch = Box::new(Stmt::statement(input)?);
let else_branch = if input.peek(kw::keyword_else) {
Some(Box::new(Stmt::statement(input)?))
} else {
None
};
Ok(Stmt::If {
condition,
then_branch,
else_branch,
})
}
fn print_statement(input: ParseStream<'_>) -> Result<Self> {
let _: kw::keyword_print = input.parse()?;
let value = input.parse()?;
let _: Punct![";"] = input.parse()?;
Ok(Self::Print(value))
}
fn return_statement(input: ParseStream<'_>) -> Result<Self> {
let keyword: kw::keyword_return = input.parse()?;
let value = if input.peek(Punct![";"]) {
None
} else {
Some(input.parse()?)
};
let _: Punct![";"] = input.parse()?;
Ok(Stmt::Return { keyword, value })
}
fn while_statement(input: ParseStream<'_>) -> Result<Self> {
let _: kw::keyword_while = input.parse()?;
let condition: Group<Parentheses> = input.parse()?;
let condition = parse(condition.into_token_stream())?;
let body = Box::new(Stmt::statement(input)?);
Ok(Stmt::While { condition, body })
}
sourcepub fn delimiters(&self) -> D
pub fn delimiters(&self) -> D
Returns a token representing the delimiters of this group.
Examples found in repository?
examples/lox/main.rs (line 358)
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
fn finish_call(input: ParseStream<'_>, callee: Expr) -> Result<Self> {
let mut contents: Group<Parentheses> = input.parse()?;
contents.remove_whitespace();
let paren = contents.delimiters();
let arguments: Punctuated<Expr, Punct![","]> =
Punctuated::parse_separated_trailing.parse(contents.into_token_stream())?;
let arguments: Vec<_> = arguments.into_iter().collect();
if arguments.len() >= 255 {
input.add_error(input.new_error(
"Can't have more than 254 arguments".to_string(),
paren.0.clone(),
error_codes::TOO_MANY_ARGS,
));
}
Ok(Expr::Call {
callee: Box::new(callee),
paren,
arguments,
})
}
fn primary(input: ParseStream<'_>) -> Result<Self> {
let lookahead = input.lookahead();
if lookahead.peek(kw::keyword_false) {
Ok(Expr::Literal(Literal::False(input.parse()?)))
} else if lookahead.peek(kw::keyword_true) {
Ok(Expr::Literal(Literal::True(input.parse()?)))
} else if lookahead.peek(kw::keyword_nil) {
Ok(Expr::Literal(Literal::Nil(input.parse()?)))
} else if lookahead.peek(LitFloat) {
Ok(Expr::Literal(Literal::Float(input.parse()?)))
} else if lookahead.peek(LitInt) {
Ok(Expr::Literal(Literal::Int(input.parse()?)))
} else if lookahead.peek(LitStr) {
Ok(Expr::Literal(Literal::String(input.parse()?)))
} else if input.peek(kw::keyword_super) {
Ok(Expr::Super {
keyword: input.parse()?,
distance: Cell::new(None),
dot: input.parse()?,
method: input.parse()?,
})
} else if input.peek(kw::keyword_this) {
Ok(Expr::This {
keyword: input.parse()?,
distance: Cell::new(None),
})
} else if lookahead.peek(Ident) {
Ok(Expr::Variable {
name: kw::ident(input)?,
distance: Cell::new(None),
})
} else if lookahead.peek(Punct!["("]) {
let group: Group<Parentheses> = input.parse()?;
Ok(Expr::Group(Box::new(parse(group.into_token_stream())?)))
} else {
Err(lookahead.error())
}
}
}
impl Parse for Expr {
fn parse(input: ParseStream<'_>) -> Result<Self> {
Expr::assignment(input)
}
}
#[derive(Debug, Clone, PartialEq)]
struct Function {
name: Ident,
params: Vec<Ident>,
body: Vec<Stmt>,
}
impl Parse for Function {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let name: Ident = input.parse()?;
let mut contents: Group<Parentheses> = input.parse()?;
contents.remove_whitespace();
let Parentheses(span) = contents.delimiters();
let tokens = contents.into_token_stream();
let params: Vec<Ident> = if tokens.is_empty() {
vec![]
} else {
let params: Punctuated<Ident, Punct![","]> =
Punctuated::parse_separated.parse(tokens)?;
params.into_iter().collect()
};
if params.len() >= 255 {
input.add_error(input.new_error(
"Can't have more than 254 parameters".to_string(),
span,
error_codes::TOO_MANY_ARGS,
));
}
let mut contents: Group<Braces> = input.parse()?;
contents.remove_whitespace();
let body = block.parse(contents.into_token_stream())?;
Ok(Function { name, params, body })
}
sourcepub fn remove_whitespace(&mut self)
pub fn remove_whitespace(&mut self)
Removes whitespace from the tokenstream in self
.
Examples found in repository?
examples/lox/main.rs (line 357)
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624
fn finish_call(input: ParseStream<'_>, callee: Expr) -> Result<Self> {
let mut contents: Group<Parentheses> = input.parse()?;
contents.remove_whitespace();
let paren = contents.delimiters();
let arguments: Punctuated<Expr, Punct![","]> =
Punctuated::parse_separated_trailing.parse(contents.into_token_stream())?;
let arguments: Vec<_> = arguments.into_iter().collect();
if arguments.len() >= 255 {
input.add_error(input.new_error(
"Can't have more than 254 arguments".to_string(),
paren.0.clone(),
error_codes::TOO_MANY_ARGS,
));
}
Ok(Expr::Call {
callee: Box::new(callee),
paren,
arguments,
})
}
fn primary(input: ParseStream<'_>) -> Result<Self> {
let lookahead = input.lookahead();
if lookahead.peek(kw::keyword_false) {
Ok(Expr::Literal(Literal::False(input.parse()?)))
} else if lookahead.peek(kw::keyword_true) {
Ok(Expr::Literal(Literal::True(input.parse()?)))
} else if lookahead.peek(kw::keyword_nil) {
Ok(Expr::Literal(Literal::Nil(input.parse()?)))
} else if lookahead.peek(LitFloat) {
Ok(Expr::Literal(Literal::Float(input.parse()?)))
} else if lookahead.peek(LitInt) {
Ok(Expr::Literal(Literal::Int(input.parse()?)))
} else if lookahead.peek(LitStr) {
Ok(Expr::Literal(Literal::String(input.parse()?)))
} else if input.peek(kw::keyword_super) {
Ok(Expr::Super {
keyword: input.parse()?,
distance: Cell::new(None),
dot: input.parse()?,
method: input.parse()?,
})
} else if input.peek(kw::keyword_this) {
Ok(Expr::This {
keyword: input.parse()?,
distance: Cell::new(None),
})
} else if lookahead.peek(Ident) {
Ok(Expr::Variable {
name: kw::ident(input)?,
distance: Cell::new(None),
})
} else if lookahead.peek(Punct!["("]) {
let group: Group<Parentheses> = input.parse()?;
Ok(Expr::Group(Box::new(parse(group.into_token_stream())?)))
} else {
Err(lookahead.error())
}
}
}
impl Parse for Expr {
fn parse(input: ParseStream<'_>) -> Result<Self> {
Expr::assignment(input)
}
}
#[derive(Debug, Clone, PartialEq)]
struct Function {
name: Ident,
params: Vec<Ident>,
body: Vec<Stmt>,
}
impl Parse for Function {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let name: Ident = input.parse()?;
let mut contents: Group<Parentheses> = input.parse()?;
contents.remove_whitespace();
let Parentheses(span) = contents.delimiters();
let tokens = contents.into_token_stream();
let params: Vec<Ident> = if tokens.is_empty() {
vec![]
} else {
let params: Punctuated<Ident, Punct![","]> =
Punctuated::parse_separated.parse(tokens)?;
params.into_iter().collect()
};
if params.len() >= 255 {
input.add_error(input.new_error(
"Can't have more than 254 parameters".to_string(),
span,
error_codes::TOO_MANY_ARGS,
));
}
let mut contents: Group<Braces> = input.parse()?;
contents.remove_whitespace();
let body = block.parse(contents.into_token_stream())?;
Ok(Function { name, params, body })
}
}
#[derive(Debug, Clone, PartialEq)]
enum Stmt {
Block(Vec<Stmt>),
Class {
name: Ident,
superclass: Option<Ident>,
superclass_distance: Cell<Option<usize>>,
methods: Vec<Function>,
},
Expr(Expr),
Function(Function),
If {
condition: Expr,
then_branch: Box<Stmt>,
else_branch: Option<Box<Stmt>>,
},
Print(Expr),
Return {
keyword: kw::keyword_return,
value: Option<Expr>,
},
Variable {
name: Ident,
initialiser: Option<Expr>,
},
While {
condition: Expr,
body: Box<Stmt>,
},
}
fn block(input: ParseStream<'_>) -> Result<Vec<Stmt>> {
let mut statements = vec![];
while !input.is_empty() {
statements.push(Stmt::declaration(input)?);
}
Ok(statements)
}
impl Stmt {
fn declaration(input: ParseStream<'_>) -> Result<Self> {
if input.peek(kw::keyword_class) {
Stmt::class_declaration(input)
} else if input.peek(kw::keyword_fun) {
let _: kw::keyword_fun = input.parse()?;
Ok(Stmt::Function(Function::parse(input)?))
} else if input.peek(kw::keyword_var) {
Stmt::var_declaration(input)
} else {
Stmt::statement(input)
}
}
fn class_declaration(input: ParseStream<'_>) -> Result<Self> {
let _: kw::keyword_class = input.parse()?;
let name: Ident = input.parse()?;
let superclass = if input.peek(Punct!["<"]) {
let _: Punct!["<"] = input.parse()?;
Some(input.parse()?)
} else {
None
};
let mut contents: Group<Braces> = input.parse()?;
contents.remove_whitespace();
let methods = parse_repeated.parse(contents.into_token_stream())?;
Ok(Stmt::Class {
name,
superclass,
superclass_distance: Cell::new(None),
methods,
})
}
fn var_declaration(input: ParseStream<'_>) -> Result<Self> {
let _: kw::keyword_var = input.parse()?;
let name = kw::ident(input)?;
let initialiser = if input.peek(Punct!["="]) {
let _: Punct!["="] = input.parse()?;
Some(input.parse()?)
} else {
None
};
let _: Punct![";"] = input.parse()?;
Ok(Stmt::Variable { name, initialiser })
}
fn statement(input: ParseStream<'_>) -> Result<Self> {
if input.peek(kw::keyword_if) {
Stmt::if_statement(input)
} else if input.peek(kw::keyword_for) {
Stmt::for_statement(input)
} else if input.peek(kw::keyword_print) {
Stmt::print_statement(input)
} else if input.peek(kw::keyword_return) {
Stmt::return_statement(input)
} else if input.peek(kw::keyword_while) {
Stmt::while_statement(input)
} else if input.peek(Punct!["{"]) {
let mut group: Group<Braces> = input.parse()?;
group.remove_whitespace();
Ok(Stmt::Block(block.parse(group.into_token_stream())?))
} else {
Stmt::expression_statement(input)
}
}
fn for_statement(input: ParseStream<'_>) -> Result<Self> {
struct ForInner(Option<Stmt>, Expr, Option<Expr>);
impl Parse for ForInner {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let initialiser = if input.peek(Punct![";"]) {
let _: Punct![";"] = input.parse()?;
None
} else if input.peek(kw::keyword_var) {
Some(Stmt::var_declaration(input)?)
} else {
Some(Stmt::expression_statement(input)?)
};
let condition = if input.peek(Punct![";"]) {
Expr::Literal(Literal::True(kw::keyword_true::new(input)))
} else {
Expr::parse(input)?
};
let _: Punct![";"] = input.parse()?;
let increment = if input.is_empty() {
None
} else {
Some(Expr::parse(input)?)
};
Ok(ForInner(initialiser, condition, increment))
}
}
let _: kw::keyword_for = input.parse()?;
let mut inner: Group<Parentheses> = input.parse()?;
inner.remove_whitespace();
let ForInner(initialiser, condition, increment) = parse(inner.into_token_stream())?;
let mut body = Stmt::statement(input)?;
if let Some(increment) = increment {
body = Stmt::Block(vec![body, Stmt::Expr(increment)]);
}
body = Stmt::While {
condition,
body: Box::new(body),
};
if let Some(initialiser) = initialiser {
body = Stmt::Block(vec![initialiser, body]);
}
Ok(body)
}
Trait Implementations§
source§impl<D: Delimiters> Parse for Group<D>
impl<D: Delimiters> Parse for Group<D>
source§fn parse(input: ParseStream<'_>) -> Result<Self>
fn parse(input: ParseStream<'_>) -> Result<Self>
Parses the input into this type.
Auto Trait Implementations§
impl<D> RefUnwindSafe for Group<D>where D: RefUnwindSafe,
impl<D> !Send for Group<D>
impl<D> !Sync for Group<D>
impl<D> Unpin for Group<D>where D: Unpin,
impl<D> UnwindSafe for Group<D>where D: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more