summaryrefslogtreecommitdiff
path: root/platform/darwin/scripts/generate-style-code.js
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-07-20 13:06:01 -0700
committerChris Loer <chris.loer@mapbox.com>2018-07-23 13:33:27 -0700
commit0b2221cb74ab79a0610ac44cee2a053da41a3dff (patch)
tree372e3e3215d70676c4625476889b4d9dbb6cd434 /platform/darwin/scripts/generate-style-code.js
parentf9b36f9f5b4cf09e08c2ff0181b339b53e8d0014 (diff)
downloadqtlocation-mapboxgl-0b2221cb74ab79a0610ac44cee2a053da41a3dff.tar.gz
[android, ios, macos] Generate symbol-placement: line-center wrappers
Diffstat (limited to 'platform/darwin/scripts/generate-style-code.js')
-rwxr-xr-xplatform/darwin/scripts/generate-style-code.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/platform/darwin/scripts/generate-style-code.js b/platform/darwin/scripts/generate-style-code.js
index 3809e9c636..0e5bf89fd4 100755
--- a/platform/darwin/scripts/generate-style-code.js
+++ b/platform/darwin/scripts/generate-style-code.js
@@ -248,13 +248,20 @@ global.testHelperMessage = function (property, layerType, isFunction) {
global.propertyDoc = function (propertyName, property, layerType, kind) {
// Match references to other property names & values.
// Requires the format 'When `foo` is set to `bar`,'.
- let doc = property.doc.replace(/`([^`]+?)` is set to `([^`]+?)`/g, function (m, peerPropertyName, propertyValue, offset, str) {
+ let doc = property.doc.replace(/`([^`]+?)` is set to `([^`]+?)`(?: or `([^`]+?)`)?/g, function (m, peerPropertyName, propertyValue, secondPropertyValue, offset, str) {
let otherProperty = camelizeWithLeadingLowercase(peerPropertyName);
let otherValue = objCType(layerType, peerPropertyName) + camelize(propertyValue);
if (property.type == 'array' && kind == 'light') {
otherValue = propertyValue;
}
- return '`' + `${otherProperty}` + '` is set to `' + `${otherValue}` + '`';
+ const firstPropertyValue = '`' + `${otherProperty}` + '` is set to `' + `${otherValue}` + '`';
+ if (secondPropertyValue) {
+ return firstPropertyValue + ' or `' +
+ objCType(layerType, peerPropertyName) + camelize(secondPropertyValue) +
+ '`';
+ } else {
+ return firstPropertyValue;
+ }
});
// Match references to our own property values.
// Requires the format 'is equivalent to `bar`'.