diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2018-04-16 15:29:38 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2018-04-16 16:27:56 -0700 |
commit | 3a0a3e42819c7d2954795edb6bdbc284737dc77d (patch) | |
tree | 6767ff4045e1dfd414963ac95d56054ce5e869ee /platform/darwin/scripts | |
parent | 3d3b87e020b727d38c56d0c9aa357cf8d4f14951 (diff) | |
download | qtlocation-mapboxgl-3a0a3e42819c7d2954795edb6bdbc284737dc77d.tar.gz |
[macos] Replaced UIColor with NSColor in documentation
Diffstat (limited to 'platform/darwin/scripts')
-rwxr-xr-x | platform/darwin/scripts/generate-style-code.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js index 8e82a8eb63..9ea5dd3e80 100755 --- a/platform/darwin/scripts/generate-style-code.js +++ b/platform/darwin/scripts/generate-style-code.js @@ -664,13 +664,13 @@ function duplicatePlatformDecls(src) { // Look for a documentation comment that contains “MGLColor” or “UIColor” // and the subsequent function, method, or property declaration. Try not to // match greedily. - return src.replace(/(\/\*\*(?:\*[^\/]|[^*])*?\*\/)(\s*[^;]+?\b(?:MGL|NS|UI)(?:Color|EdgeInsets(?:Zero)?)\b[^;]+?;)/g, + return src.replace(/(\/\*\*(?:\*[^\/]|[^*])*?\b(?:MGL|NS|UI)Color\b[\s\S]*?\*\/)(\s*.+?;)/g, (match, comment, decl) => { - let macosComment = comment.replace(/\b(?:MGL|UI)(Color|EdgeInsets(?:Zero)?)\b/g, 'NS$1') + let macosComment = comment.replace(/\b(?:MGL|UI)Color\b/g, 'NSColor') // Use the correct indefinite article. - .replace(/\ba(\s+`?NS(?:Color|EdgeInsets))\b/gi, 'an$1'); - let iosDecl = decl.replace(/\bMGL(Color|EdgeInsets)\b/g, 'UI$1'); - let macosDecl = decl.replace(/\b(?:MGL|UI)(Color|EdgeInsets)\b/g, 'NS$1'); + .replace(/\ba(\s+`?NSColor)\b/gi, 'an$1'); + let iosDecl = decl.replace(/\bMGLColor\b/g, 'UIColor'); + let macosDecl = decl.replace(/\b(?:MGL|UI)Color\b/g, 'NSColor'); return `\ #if TARGET_OS_IPHONE ${comment}${iosDecl} |