///|
// Raw STEP entity used to preserve unknown/unmodeled DATA entities.
//
// This is intentionally separate from `UnknownEntity`, which is a placeholder
// type for references whose entity type isn't modeled yet.

///|
/// An untyped STEP entity captured verbatim from the source file.
///
/// `args` is the raw argument list exactly as written in the file
/// (including surrounding parentheses); `to_step` re-emits `name` + `args`
/// unchanged, so unknown entities round-trip through a parse/write cycle
/// losslessly. Compare with `UnknownEntity`, which marks references whose
/// target type is not modeled yet.
pub struct RawEntity {
  name : String
  args : String
}

///|
/// Construct a raw entity from an entity name and its raw argument list.
///
/// `args` must include the surrounding parentheses exactly as they should
/// be re-emitted (for example `"(#1,#2)"`).
pub fn RawEntity::new(name : String, args : String) -> RawEntity {
  RawEntity::{ name, args, }
}

///|
pub impl Entity for RawEntity with fn to_step(self) {
  "\{self.name}\{self.args}"
}

///|
pub extend RawEntity with Entity::{to_step}