From be191651402d14876ed4ec0c1abaa8a8e106ee80 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Sat, 13 Nov 2021 20:34:56 +0100 Subject: [PATCH] Doc fixes. --- src/gsi/gsi/gsiDeclBasic.cc | 13 +++++++++---- src/lym/lym/gsiDeclLymMacro.cc | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/gsi/gsi/gsiDeclBasic.cc b/src/gsi/gsi/gsiDeclBasic.cc index dab1ce035..bd10db3be 100644 --- a/src/gsi/gsi/gsiDeclBasic.cc +++ b/src/gsi/gsi/gsiDeclBasic.cc @@ -127,8 +127,8 @@ Class decl_Macro ("tl", "Interpreter", "Use 'filename' and 'line' to indicate the original source for the error messages.\n" ) + gsi::method_ext ("define_variable", &define_variable_impl, gsi::arg ("name"), gsi::arg ("value"), - "@brief Defines A (global) variable with the given name and value\n" - "You can use the \\Value class to provide 'out' parameters which can be modified by code executed inside the interpreter." + "@brief Defines a (global) variable with the given name and value\n" + "You can use the \\Value class to provide 'out' or 'inout' parameters which can be modified by code executed inside the interpreter and read back by the caller." ) + gsi::method ("python_interpreter", &python_interpreter, "@brief Gets the instance of the Python interpreter\n" @@ -138,15 +138,20 @@ Class decl_Macro ("tl", "Interpreter", ), "@brief A generalization of script interpreters\n" "The main purpose of this class is to provide cross-language call options. " - "Using the Python interpreter, it is possible to execute Python code from Ruby and vice versa.\n" + "Using the Python interpreter, it is possible to execute Python code from Ruby for example.\n" + "\n" + "The following example shows how to use the interpreter class to execute Python code from Ruby " + "and how to pass values from Ruby to Python and back using the \\Value wrapper object:\n" "\n" "@code\n" "pya = RBA::Interpreter::python_interpreter\n" "out_param = RBA::Value::new(17)\n" "pya.define_variable(\"out_param\", out_param)\n" - "pya.eval_string(\"print(\"This is Python now!\")\nout_param.value = out_param.value + 25\")\n" + "pya.eval_string(\"print(\\\"This is Python now!\\\")\\nout_param.value = out_param.value + 25\")\n" "puts out_param.value # gives '42'" "@/code\n" + "\n" + "This class was introduced in version 0.27.5.\n" ); } diff --git a/src/lym/lym/gsiDeclLymMacro.cc b/src/lym/lym/gsiDeclLymMacro.cc index d41d4ef80..91ba0da3e 100644 --- a/src/lym/lym/gsiDeclLymMacro.cc +++ b/src/lym/lym/gsiDeclLymMacro.cc @@ -514,7 +514,7 @@ lym::Macro *new_from_path (const std::string &path) } Class decl_Macro ("lay", "Macro", - gsi::constructor ("new", &new_from_path, + gsi::constructor ("new", &new_from_path, gsi::arg ("path"), "@brief Loads the macro from the given file path\n" "\n" "This constructor has been introduced in version 0.27.5.\n"