yamlscript wip

put yamlscript fns in the global namespace
yamlscript functions were moved to that repo
This commit is contained in:
Joao Paulo Magalhaes
2024-05-08 13:42:51 +02:00
parent 1f8a10dfbc
commit b55c6823df
3 changed files with 12 additions and 11 deletions

View File

@@ -9,6 +9,15 @@
namespace c4 {
namespace yml {
std::string emit_events_from_source(substr src)
{
EventHandlerYamlStd::EventSink sink;
EventHandlerYamlStd handler(&sink);
ParseEngine<EventHandlerYamlStd> parser(&handler);
parser.parse_in_place_ev("(testyaml)", src);
return sink.result;
}
// instantiate the template
template class ParseEngine<EventHandlerYamlStd>;

View File

@@ -21,6 +21,7 @@ C4_SUPPRESS_WARNING_GCC_CLANG_PUSH
C4_SUPPRESS_WARNING_GCC_CLANG("-Wold-style-cast")
C4_SUPPRESS_WARNING_GCC("-Wuseless-cast")
namespace c4 {
namespace yml {
@@ -28,6 +29,8 @@ namespace yml {
/** @addtogroup doc_event_handlers
* @{ */
std::string emit_events_from_source(substr src);
/** The stack state needed specifically by @ref EventHandlerYamlStd */
struct EventHandlerYamlStdState : public ParserState
{

View File

@@ -8,17 +8,6 @@
namespace c4 {
namespace yml {
std::string emit_events_from_source(substr src)
{
EventHandlerYamlStd::EventSink sink;
EventHandlerYamlStd handler(&sink);
ParseEngine<EventHandlerYamlStd> parser(&handler);
parser.parse_in_place_ev("(testyaml)", src);
return sink.result;
}
namespace /*anon*/ {
csubstr filtered_scalar(csubstr str, Tree *tree)