File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -48,27 +48,34 @@ void Syntax::loadSyntaxRules(const YAML::Node &config)
4848 {
4949
5050 QString regex;
51- try {
51+ try
52+ {
5253 std::string regexStr = rule[" regex" ].as <std::string>(); // will throw exception if the key does not exist
53- regex = QString::fromStdString (regexStr);
54- }catch (const YAML::Exception e){
54+ regex = QString::fromStdString (regexStr);
55+ }
56+ catch (const YAML::Exception e)
57+ {
5558 qWarning () << " YAML exception when parsion the regex in syntax file" << e.what ();
5659 continue ;
5760 }
5861
5962 qDebug () << " regex: " << regex;
6063
6164 QColor color;
62- try {
65+ try
66+ {
6367 std::string colorStr = rule[" color" ].as <std::string>();
64- color = QColor (QString::fromStdString (colorStr));
65- }catch (const YAML::Exception e){
68+ color = QColor (QString::fromStdString (colorStr));
69+ }
70+ catch (const YAML::Exception e)
71+ {
6672 qWarning () << " YAML exception when parsion the color in syntax file" << e.what ();
6773 continue ;
6874 }
6975
7076 // checks if the color is a valid color
71- if (!color.isValid ()){
77+ if (!color.isValid ())
78+ {
7279 qWarning () << " Invalid COlor : Skipping..." ;
7380 continue ;
7481 }
You can’t perform that action at this time.
0 commit comments