[−][src]Function liblet::production::production
pub fn production(lhs: &str, rhs: &str) -> Production
Convenience function for creating a production from a pair of raw strings (left hand side and right hand side).
It returns the production directly,
as opposed to the Result
returned from the production constructor.
Panics
Panics if some error occurred during production creation (see production consructor for further details)
Examples
use liblet::production::production; use liblet::symbol::symbol; let p = production("A", "B C"); assert_eq!(p.lhs(), vec![symbol("A")]); assert_eq!(p.rhs(), vec![symbol("B"),symbol("C")]);