-- | Execute a primitive command.
executePrimitive :: HandleTeXIO m => Primitive -> LexerT m [Token]
executePrimitive name = fromMaybe throwError $ lookup name primitiveMeanings
  where
    throwError = error $ "Call to undefined primitive: " ++ name

-------------------- Handle builtin macros

---------- Builtin macros: file input
executePrimitive :: HandleTeXIO m => Primitive -> LexerT m [Token]
executePrimitive name = fromMaybe throwError $ lookup name primitiveMeanings
  where
    throwError = error $ "Call to undefined primitive: " ++ name

-------------------- Handle builtin macros

---------- Builtin macros: file input
executePrimitive name = fromMaybe throwError $ lookup name primitiveMeanings
  where
    throwError = error $ "Call to undefined primitive: " ++ name

-------------------- Handle builtin macros

---------- Builtin macros: file input