| 5207 | | |
| 5208 | | '$lgt_tr_file_directive'(op(Pr, Spec, Ops)) :- % op/3 directives must be used during entity compilation |
| 5209 | | !, |
| 5210 | | ( '$lgt_valid_op_priority'(Pr) -> |
| 5211 | | ( '$lgt_valid_op_specifier'(Spec) -> |
| 5212 | | ( '$lgt_valid_op_names'(Ops) -> |
| 5213 | | assertz('$lgt_pp_directive_'(op(Pr, Spec, Ops))), |
| 5214 | | assertz('$lgt_pp_file_op_'(op(Pr, Spec, Ops))), |
| 5215 | | op(Pr, Spec, Ops) |
| 5216 | | ; throw(type_error(operator_name, Ops)) |
| 5217 | | ) |
| 5218 | | ; throw(type_error(operator_specifier, Spec)) |
| 5219 | | ) |
| 5220 | | ; throw(type_error(operator_priority, Pr)) |
| 5221 | | ). |
| | 5207 | % |
| | 5208 | % translates file-level directives, i.e. directives that are not encapsulated in a Logtalk entity |
| | 5209 | % error-checking is delegated to the back-end Prolog compiler |
| | 5210 | |
| | 5211 | '$lgt_tr_file_directive'(encoding(_)) :- % the encoding/1 directive is already processed |
| | 5212 | !. |
| | 5213 | |
| | 5214 | '$lgt_tr_file_directive'(ensure_loaded(File)) :- |
| | 5215 | !, |
| | 5216 | ensure_loaded(File), % assume that ensure_loaded/1 is also a built-in predicate |
| | 5217 | assertz('$lgt_pp_directive_'(ensure_loaded(File))). |
| 5230 | | '$lgt_tr_file_directive'(encoding(_)) :- % the encoding/1 directive is already processed |
| 5231 | | !. |
| | 5226 | '$lgt_tr_file_directive'(op(Pr, Spec, Ops)) :- % op/3 directives must be used during entity compilation |
| | 5227 | !, |
| | 5228 | op(Pr, Spec, Ops), |
| | 5229 | assertz('$lgt_pp_directive_'(op(Pr, Spec, Ops))), |
| | 5230 | assertz('$lgt_pp_file_op_'(op(Pr, Spec, Ops))). |
| | 5231 | |
| | 5232 | '$lgt_tr_file_directive'(set_prolog_flag(Flag, Value)) :- |
| | 5233 | !, |
| | 5234 | set_prolog_flag(Flag, Value), |
| | 5235 | assertz('$lgt_pp_directive_'(set_prolog_flag(Flag, Value))). |