diff options
-rw-r--r-- | raul/Symbol.hpp | 7 | ||||
-rw-r--r-- | test/symbol_test.cpp | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/raul/Symbol.hpp b/raul/Symbol.hpp index 8a10f5a..0aa8ed0 100644 --- a/raul/Symbol.hpp +++ b/raul/Symbol.hpp @@ -118,7 +118,12 @@ public: out[i] = '_'; } } - return Symbol(out); + + if (is_valid_start_char(out[0])) { + return Symbol(out); + } else { + return Symbol(std::string("_") + out); + } } }; diff --git a/test/symbol_test.cpp b/test/symbol_test.cpp index 547961c..5164998 100644 --- a/test/symbol_test.cpp +++ b/test/symbol_test.cpp @@ -44,6 +44,7 @@ main() names.push_back("Gain dB"); names.push_back("Dry/Wet Balance"); names.push_back("Phaser1 - Similar to CSound's phaser1 by Sean Costello"); + names.push_back("1"); names.push_back(""); for (list<string>::iterator i = names.begin(); i != names.end(); ++i) { |