1378-Update regex to match multiple parameters

removing node version changes
This commit is contained in:
Justin Greywolf 2020-06-08 18:40:18 -07:00
parent 47b5d7a2df
commit 9091d686ed
3 changed files with 5 additions and 10 deletions

View File

@ -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": {

View File

@ -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);
@ -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) {

View File

@ -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"