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 construct element flm.pres.html.tag, then the elements of FLOW_THROUGH, in that order (29 elements).

The set holds no element another feature owns; the module documentation says why.

§Examples

use flm_core::stdlib::backends::html::{FLOW_THROUGH, TAG, native_elements};
use flm_core::stdlib::backends::pres;

let native = native_elements();
assert_eq!(native.len(), pres::ALL.len() + 1 + FLOW_THROUGH.len());
assert_eq!(native.len(), 29);
assert!(native.iter().any(|element| element.as_str() == TAG));
// No element another feature owns: a reference is lowered by the `refs`
// feature's own rule, so the plan schedules the stage computing the anchors.
assert!(!native.iter().any(|element| element.as_str() == "flm.ref"));