1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-16 22:14:23 +03:00
inform7/services/problems-module/Chapter 1/Problems Module.w

34 lines
1.1 KiB
OpenEdge ABL
Raw Normal View History

2019-02-05 02:44:07 +02:00
[ProblemsModule::] Problems Module.
Setting up the use of this module.
2022-05-17 09:46:35 +03:00
@ This section simply sets up the module in ways expected by //foundation//, and
contains no code of interest. The following constant exists only in tools
which use this module:
2019-02-05 02:44:07 +02:00
@d PROBLEMS_MODULE TRUE
2020-05-20 13:36:42 +03:00
@ Note that this module uses its fellow services module //syntax//, and adds
the following annotation to the syntax tree:
@e problem_falls_under_ANNOT /* |parse_node|: what heading the sentence falls under */
=
DECLARE_ANNOTATION_FUNCTIONS(problem_falls_under, parse_node)
MAKE_ANNOTATION_FUNCTIONS(problem_falls_under, parse_node)
@ Like all modules, this one must define a |start| and |end| function.
2019-02-05 02:44:07 +02:00
=
void ProblemsModule::start(void) {
2020-05-11 17:21:29 +03:00
Annotations::allow_for_category(L2_NCAT, problem_falls_under_ANNOT);
2020-08-07 00:01:38 +03:00
Annotations::declare_type(problem_falls_under_ANNOT,
ProblemsModule::write_problem_falls_under_ANNOT);
2019-02-05 02:44:07 +02:00
}
void ProblemsModule::end(void) {
}
2020-08-07 00:01:38 +03:00
void ProblemsModule::write_problem_falls_under_ANNOT(text_stream *OUT, parse_node *p) {
if (Node::get_problem_falls_under(p))
WRITE("{under: '%W'}", Node::get_text(Node::get_problem_falls_under(p)));
}