Skip to main content

native_elements

Function native_elements 

Source
pub fn native_elements() -> Vec<ElementName>
Expand description

Returns the backend’s native element set, the elements its emitter writes without a lowering rule: every element of the presentation vocabulary (pres::ALL), the two construct elements (construct::ALL), then the elements of FLOW_THROUGH, in that order.

§Examples

use flm_core::stdlib::backends::pres;
use flm_core::stdlib::backends::text::{FLOW_THROUGH, construct, native_elements};

let native = native_elements();
assert_eq!(native.len(), pres::ALL.len() + construct::ALL.len() + FLOW_THROUGH.len());
assert!(native.iter().any(|element| element.as_str() == pres::PAR));
assert!(native.iter().any(|element| element.as_str() == construct::RULED));