Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1378 additional qualifiers bug with multiple arguments #1446

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
1378-Update regex to match multiple parameters
removing node version changes
  • Loading branch information
jgreywolf committed Jun 9, 2020
commit 9091d686ed09ad81c5bfa1927f12244ac233ffcb
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"he": "^1.2.0",
"minify": "^4.1.1",
"moment-mini": "^2.22.1",
"node": "^14.3.0",
"scope-css": "^1.2.1"
},
"devDependencies": {
Expand Down
9 changes: 5 additions & 4 deletions src/diagrams/class/svgDraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,14 @@ export const drawClass = function(elem, classDef, conf) {
};

export const parseMember = function(text) {
const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+)/;
const methodRegEx = /^(\+|-|~|#)?(\w+)\((.*)\)(\*|\$)?\s?(.*)?/;
const fieldRegEx = /^(\+|-|~|#)?(\w+)(~\w+~|\[\])?\s+(\w+)$/;
const methodRegEx = /(\+|-|~|#)?(\w+)\((.*)\)(\*|\$)? *(.*)?/;
///^(\+|-|~|#)?(\w+)\((.*)\)(\*|\$)?[ ]*(.*)?$/;

let fieldMatch = text.match(fieldRegEx);
let methodMatch = text.match(methodRegEx);

if (fieldMatch) {
if (fieldMatch && !methodMatch) {
return buildFieldDisplay(fieldMatch);
} else if (methodMatch) {
return buildMethodDisplay(methodMatch);
Expand All @@ -299,7 +300,7 @@ const buildFieldDisplay = function(parsedText) {
try {
let visibility = parsedText[1] ? parsedText[1].trim() : '';
let fieldType = parsedText[2] ? parseGenericTypes(parsedText[2]) : '';
let fieldName = parsedText[3] ? parsedText[3].trim() : '';
let fieldName = parsedText[4] ? parsedText[4].trim() : '';

displayText = visibility + fieldType + ' ' + fieldName;
} catch (err) {
Expand Down
5 changes: 0 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7548,11 +7548,6 @@ no-case@^2.2.0:
dependencies:
lower-case "^1.1.1"

node-bin-setup@^1.0.0:
version "1.0.6"
resolved "https://registry.yarnpkg.com/node-bin-setup/-/node-bin-setup-1.0.6.tgz#4b5c9bb937ece702d7069b36ca78af4684677528"
integrity sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q==

node-forge@0.9.0:
version "0.9.0"
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-0.9.0.tgz#d624050edbb44874adca12bb9a52ec63cb782579"
Expand Down