Skip to content

Commit

Permalink
Relax regexs to allow variable names that include point
Browse files Browse the repository at this point in the history
Variable names like h2.out are valid so no reason to restrict them in
custom simulation dialog and scalars print parser.
  • Loading branch information
ivandi committed Feb 17, 2024
1 parent 6868acd commit 2d3357e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion qucs/extsimkernels/abstractspicekernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ int AbstractSpiceKernel::checkRawOutupt(QString ngspice_file, QStringList &value
bool isXyce = false;
if (ofile.open(QFile::ReadOnly)) {
QTextStream ngsp_data(&ofile);
QRegularExpression prnln_rx("^\\D\\w*\\s=\\s-?\\d.\\d+[Ee][+-]\\d+");
QRegularExpression prnln_rx("^[A-Za-z].*\\s=\\s-?\\d.\\d+[Ee][+-]\\d+");
QRegularExpression rx("^0\\s+[0-9].*"); // Zero index pattern
while (!ngsp_data.atEnd()) {
QString lin = ngsp_data.readLine();
Expand Down
2 changes: 1 addition & 1 deletion qucs/extsimkernels/customsimdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ void CustomSimDialog::slotFindVars()


QStringList strings = edtCode->toPlainText().split('\n');
QRegularExpression let_pattern("^\\s*let\\s+[A-Za-z]+\\w*\\s*=.+");
QRegularExpression let_pattern("^\\s*let\\s+[A-Za-z].*=.+");

for (const QString& line : strings) {
if (let_pattern.match(line).hasMatch()) {
Expand Down

0 comments on commit 2d3357e

Please sign in to comment.