| 69 |
match Schema_common.get_component kind name schema with |
match Schema_common.get_component kind name schema with |
| 70 |
| Schema_types.Type x -> Schema_validator.validate_type x schema |
| Schema_types.Type x -> Schema_validator.validate_type x schema |
| 71 |
| Schema_types.Element x -> Schema_validator.validate_element x schema |
| Schema_types.Element x -> Schema_validator.validate_element x schema |
| 72 |
| Schema_types.Attribute x -> Schema_validator.validate_attribute x schema |
| Schema_types.Attribute x -> |
| 73 |
|
assert false (* TODO see schema/schema_validator.mli *) |
| 74 |
|
(* Schema_validator.validate_attribute x schema *) |
| 75 |
| Schema_types.Attribute_group x -> |
| Schema_types.Attribute_group x -> |
| 76 |
Schema_validator.validate_attribute_group x schema |
Schema_validator.validate_attribute_group x schema |
| 77 |
| Schema_types.Model_group x -> |
| Schema_types.Model_group x -> |
| 282 |
|
|
| 283 |
*) |
*) |
| 284 |
|
|
|
|
|
|
|
|
| 285 |
(* Evaluator for "compiled" expressions *) |
(* Evaluator for "compiled" expressions *) |
| 286 |
|
|
| 287 |
|
|
| 449 |
Value.Record (Builtin_defs.mk_ref ~get ~set) |
Value.Record (Builtin_defs.mk_ref ~get ~set) |
| 450 |
|
|
| 451 |
and eval_validate env e kind schema_name name = |
and eval_validate env e kind schema_name name = |
| 452 |
raise (CDuceExn (string_latin1 |
let schema = Typer.get_schema schema_name in |
| 453 |
"validate: not implemented for compiled expressions")) |
try |
| 454 |
|
let validate = |
| 455 |
|
match Schema_common.get_component kind name schema with |
| 456 |
|
| Schema_types.Type x -> Schema_validator.validate_type x schema |
| 457 |
|
| Schema_types.Element x -> Schema_validator.validate_element x schema |
| 458 |
|
| Schema_types.Attribute x -> |
| 459 |
|
assert false (* TODO see schema/schema_validator.mli *) |
| 460 |
|
(* Schema_validator.validate_attribute x schema *) |
| 461 |
|
| Schema_types.Attribute_group x -> |
| 462 |
|
Schema_validator.validate_attribute_group x schema |
| 463 |
|
| Schema_types.Model_group x -> |
| 464 |
|
Schema_validator.validate_model_group x schema |
| 465 |
|
in |
| 466 |
|
validate (eval env e) |
| 467 |
|
with Schema_common.XSI_validation_error msg -> |
| 468 |
|
failwith' ("Schema validation failure: " ^ msg) |
| 469 |
|
|
| 470 |
and eval_try env arg brs = |
and eval_try env arg brs = |
| 471 |
let saved_frame = !frame and saved_sp = !sp in |
let saved_frame = !frame and saved_sp = !sp in |