Parse a property for {@link _cWidget#properties} as a string
@param {_cRawDirective} raw_directive
@param {_cWidget} widget_config
429981
function(raw_directive, widget_config) {

		if (Lava.schema.DEBUG && widget_config.type != 'widget') Lava.t("property_string directive requires a widget");

		this._storeDirectiveContent(widget_config, raw_directive, 'properties');

	}
99784
function(element) {

		var widget,
			raw_template = Lava.TemplateParser.parseRaw(Firestorm.Element.getOuterHTML(element)),
			raw_tag,
			config,
			constructor;

		if (Lava.schema.DEBUG && raw_template.length != 1) Lava.t();

		raw_tag = raw_template[0];
		config = Lava.parsers.Common.toWidget(raw_tag);
		config.is_extended = true;
		config['class'] = raw_tag.attributes['lava-app'];

		if (raw_tag.attributes.id) Firestorm.Element.removeProperty(element, 'id'); // needed for captureExistingElement

		constructor = Lava.ClassManager.getConstructor(config['class'] || 'Lava.widget.Standard', 'Lava.widget');
		if (Lava.schema.DEBUG && !constructor) Lava.t('Class not found: ' + config['class']);
		widget = /** @type {Lava.widget.Standard} */ new constructor(config);
		widget.injectIntoExistingElement(element);
		return widget;

	}
979506
function(raw_directive) {

		if (Lava.schema.DEBUG && (!raw_directive.content || raw_directive.content.length != 1))
			Lava.t('Malformed static_eval directive. No content.');

		var arguments = Lava.ExpressionParser.parse(raw_directive.content[0]);

		if (Lava.schema.DEBUG && arguments.length == 0) Lava.t("static_eval: malformed argument");

		return {
			type: 'static_eval',
			argument: arguments[0]
		}

	}
1212678
function WidgetModel(Class, overrides) {
        var defaults = {
          title: 'Widget',
          name: Class.name,
          attrs: Class.attrs,
          dataAttrName: Class.dataAttrName,
          dataModelType: Class.dataModelType,
          dataModelArgs: Class.dataModelArgs, // used in data model constructor, not serialized
          //AW Need deep copy of options to support widget options editing
          dataModelOptions: Class.dataModelOptions,
          settingsModalOptions: Class.settingsModalOptions,
          onSettingsClose: Class.onSettingsClose,
          onSettingsDismiss: Class.onSettingsDismiss,
          style: Class.style
        };
        overrides = overrides || {};
        angular.extend(this, angular.copy(defaults), overrides);
        this.style = this.style || { width: '33%' };
        this.setWidth(this.style.width);

        if (Class.templateUrl) {
          this.templateUrl = Class.templateUrl;
        } else if (Class.template) {
          this.template = Class.template;
        } else {
          var directive = Class.directive || Class.name;
          this.directive = directive;
        }
      }
1104981
function(container_config, raw_attributes) {

		var name,
			list,
			static_properties = {};

		for (name in raw_attributes) {

			if (name == 'style') {

				list = this.parseStyleAttribute(raw_attributes.style);

				if (list) container_config.static_styles = list;

			} else if (name == 'class') {

				container_config.static_classes = raw_attributes['class'].trim().split(/\s+/);

			} else if (name == 'id') {

				// skip, as ID is handled separately

			} else {

				static_properties[name] = raw_attributes[name];

			}

		}

		//noinspection LoopStatementThatDoesntLoopJS
		for (name in static_properties) {
			container_config.static_properties = static_properties;
			break;
		}

	}
153958
def config
      @parsed_config ||= Nokogiri::XML(config_xml).xpath("//property").inject({}) { |props, xprop|
        props[xprop.xpath("./name").text] = xprop.xpath("./value").text
        props
      }
    end
677412
function directives() {
    var i, p, pn;

    for (;;) {
      if (state.tokens.next.id === "(string)") {
        p = peek(0);
        if (p.id === "(endline)") {
          i = 1;
          do {
            pn = peek(i);
            i = i + 1;
          } while (pn.id === "(endline)");

          if (pn.id !== ";") {
            if (pn.id !== "(string)" && pn.id !== "(number)" &&
              pn.id !== "(regexp)" && pn.identifier !== true &&
              pn.id !== "}") {
              break;
            }
            warning("W033", state.tokens.next);
          } else {
            p = pn;
          }
        } else if (p.id === "}") {
          // Directive with no other statements, warn about missing semicolon
          warning("W033", p);
        } else if (p.id !== ";") {
          break;
        }

        advance();
        if (state.directive[state.tokens.curr.value]) {
          warning("W034", state.tokens.curr, state.tokens.curr.value);
        }

        if (state.tokens.curr.value === "use strict") {
          if (!state.option["(explicitNewcap)"])
            state.option.newcap = true;
          state.option.undef = true;
        }

        // there's no directive negation, so always set to true
        state.directive[state.tokens.curr.value] = true;

        if (p.id === ";") {
          advance(";");
        }
        continue;
      }
      break;
    }
  }
1298902
public static void parseCacheControl(String directives, BiConsumer<String, String> callback) {
        final int len = directives.length();
        for (int i = 0; i < len;) {
            final int nameStart = i;
            final String name;
            final String value;

            // Find the name.
            for (; i < len; i++) {
                final char ch = directives.charAt(i);
                if (ch == ',' || ch == '=') {
                    break;
                }
            }
            name = directives.substring(nameStart, i).trim();

            // Find the value.
            if (i == len || directives.charAt(i) == ',') {
                // Skip comma or go beyond 'len' to break the loop.
                i++;
                value = null;
            } else {
                // Skip '='.
                i++;

                // Skip whitespaces.
                for (; i < len; i++) {
                    final char ch = directives.charAt(i);
                    if (ch != ' ' && ch != '\t') {
                        break;
                    }
                }

                if (i < len && directives.charAt(i) == '\"') {
                    // Handle quoted string.
                    // Skip the opening quote.
                    i++;
                    final int valueStart = i;

                    // Find the closing quote.
                    for (; i < len; i++) {
                        if (directives.charAt(i) == '\"') {
                            break;
                        }
                    }
                    value = directives.substring(valueStart, i);

                    // Skip the closing quote.
                    i++;

                    // Find the comma and skip it.
                    for (; i < len; i++) {
                        if (directives.charAt(i) == ',') {
                            i++;
                            break;
                        }
                    }
                } else {
                    // Handle unquoted string.
                    final int valueStart = i;

                    // Find the comma.
                    for (; i < len; i++) {
                        if (directives.charAt(i) == ',') {
                            break;
                        }
                    }
                    value = directives.substring(valueStart, i).trim();

                    // Skip the comma.
                    i++;
                }
            }

            if (!name.isEmpty()) {
                callback.accept(Ascii.toLowerCase(name), Strings.emptyToNull(value));
            }
        }
    }
1317478
function parse( doxComment, options ) {
   if( !( 'ctx' in doxComment ) ) {
      doxComment.ctx = false;
   }

   const parsed = {
      // An explicitly given name is used in favor of a derived one.
      name: ( tagsByType( doxComment.tags, 'name', 'directive', 'injection', 'module' )[ 0 ] || {} ).string ||
         doxComment.ctx.name ||
         '- unknown -',
      description: description( doxComment ),
      dox: doxComment
   };

   const optional = [];
   parsed.params = tagsByType( doxComment.tags, 'param' )
      .map( tag => {
         const cleanName = tag.name.replace( /^\[?([^\]]*)]?$/g, '$1' );
         const parents = cleanName.split( '.' ).slice( 0, -1 );
         if( tag.optional ) {
            optional.push( cleanName );
         }
         else if( parents.some( p => optional.indexOf( p ) !== -1 ) ) {
            // a property of an optional object parameter is optional too
            optional.push( cleanName );
            tag.optional = true;
         }

         return {
            name: cleanName,
            types: tag.types.length === 0 ? [ '*' ] : tag.types,
            description: convertLineBreaks( description( tag ) ),
            dox: tag
         };
      } );

   parsed.paramsForArgsList = parsed.params
      // filter out object parameter properties for argument list
      .filter( param => param.name.indexOf( '.' ) === -1 )
      .map( param => param.name );

   parsed.returns = tagsByType( doxComment.tags, 'return', 'returns' )
      .map( tag =>
         ({
            name: tag.name,
            types: tag.types.length === 0 ? [ '*' ] : tag.types,
            description: convertLineBreaks( description( tag ) ),
            dox: tag
         })
      )[ 0 ] || null;

   if( options.verbose ) {
      /* eslint-disable no-console */
      console.log( JSON.stringify( parsed, null, 3 ) );
      /* eslint-enable no-console */
   }

   return parsed;
}
1368676
public static List<ConfigurationKeyPart> parse(String raw, Map<String, String> contextOverrides)
    {
        List<ConfigurationKeyPart> parts = Lists.newArrayList();

        int caret = 0;
        for (; ; )
        {
            int startIndex = raw.indexOf("${", caret);
            if ( startIndex < 0 )
            {
                break;
            }
            int endIndex = raw.indexOf("}", startIndex);
            if ( endIndex < 0 )
            {
                break;
            }

            if ( startIndex > caret )
            {
                parts.add(new ConfigurationKeyPart(raw.substring(caret, startIndex), false));
            }
            startIndex += 2;
            if ( startIndex < endIndex )
            {
                String name = raw.substring(startIndex, endIndex);
                if (contextOverrides != null && contextOverrides.containsKey(name)) {
                    parts.add(new ConfigurationKeyPart(contextOverrides.get(name), false));
                }
                else {
                    parts.add(new ConfigurationKeyPart(name, true));
                }
            }
            caret = endIndex + 1;
        }

        if ( caret < raw.length() )
        {
            parts.add(new ConfigurationKeyPart(raw.substring(caret), false));
        }

        if ( parts.size() == 0 )
        {
            parts.add(new ConfigurationKeyPart("", false));
        }

        return parts;
    }
89267
function (cfg, context, lineNumber) {
        this.$BaseWidget.constructor.apply(this, arguments);

        this._cfgOk = ariaCoreJsonValidator.validateCfg("aria.touch.widgets.SliderCfgBeans.SliderCfg", cfg);
        if (!this._cfgOk) {
            return;
        }

        /**
         * Value of the widget (must be between 0 and 1)
         * @type Number
         * @protected
         */
        this._value = 0;

        this._readValue();
        /**
         * Id generated for the button DOM element of the slider.
         * @type String
         * @protected
         */
        this._domId = cfg.id ? context.$getId(cfg.id) : this._createDynamicId();
        /**
         * Id generated for the highlight element.
         * @type String
         * @protected
         */
        this._highlightDomId = this._domId + "_highlight";
        /**
         * Id generated for the slider container element.
         * @type String
         * @protected
         */
        this._parentDomId = this._domId + "_parent";
        /**
         * Id generated for the slider switch on container element.
         * @type String
         * @protected
         */
        this._onSwitchId = this._domId + "_on";
        /**
         * Id generated for the slider switch off container element.
         * @type String
         * @protected
         */
        this._offSwitchId = this._domId + "_off";
        /**
         * Flag used for switching between switch and slider.
         * @type Boolean
         * @protected
         */
        this._isSwitch = cfg.toggleSwitch;

        /**
         * When using the widget as switch, this is the value above which all value are converted to 1
         * @type {Float}
         * @protected
         */
        this._switchThreshold = cfg.switchThreshold != null ? Math.min(1, Math.max(0, cfg.switchThreshold)) : 0.5;

        /**
         * Label for the on side of the switch.
         * @type String
         * @protected
         */
        this._onLabel = cfg.onLabel || "ON";

        /**
         * Label for the off side of the switch.
         * @type String
         * @protected
         */
        this._offLabel = cfg.offLabel || "OFF";

        /**
         * Reference to the on state DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._onContainer = null;
        /**
         * Reference to the off state DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._offContainer = null;

        /**
         * Reference to the button DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._slider = null;
        /**
         * Reference to the highlight DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._highlight = null;
        /**
         * Reference to the Container DOM element of the slider.
         * @type HTMLElement
         * @protected
         */
        this._sliderContainer = null;
        /**
         * Reference to the Width of the Thumb.
         * @type Number
         * @protected
         */
        this._sliderWidth = null;
        /**
         * Reference to the Dimension of the Slider.
         * @type {aria.utils.DomBeans:Geometry}
         * @protected
         */
        this._sliderDimension = null;

        /**
         * Width of the rail in which thumb travels.
         * @type {Number
         * @protected
         */
        this._railWidth = null;

        /**
         * Value of the page/clientX property of the touch event when the user started moving the slider. It is then
         * updated so that it is always the position of the touch for which there is no change of the position of the
         * slider.
         * @type Number
         * @protected
         */
        this._savedX = null;

        /**
         * Initial position of the element being dragged
         * @type {Number}
         * @protected
         */
        this._initialDrag = null;

        /**
         * ID used for delegating events
         * @type {String}
         */
        this._delegateId = null;

        var binding = this._cfg.bind ? this._cfg.bind.value : null;
        this._binding = binding;
        if (binding) {
            this._bindingCallback = {
                fn : this._notifyDataChange,
                scope : this,
                args : true
            };
            ariaUtilsJson.addListener(binding.inside, binding.to, this._bindingCallback, false);
        }
        /**
         * Drag instances associated to the thumb
         * @type {String} of aria.utils.dragdrop.Drag
         */
        this._draggable = null;
    }
579500
function(raw_directive) {

		if (Lava.schema.DEBUG && !('attributes' in raw_directive)) Lava.t("Widget definition is missing attributes");

		var tags = raw_directive.content ? Lava.parsers.Common.asBlockType(raw_directive.content, 'tag') : [],
			widget_config = {},
			i = 0,
			count = tags.length,
			tag,
			name,
			path,
			is_storage_parsed = false;

		this._widget_directives_stack.push(raw_directive);

		if (count) {

			if (tags[0].name == 'view') {

				widget_config = this._asMainView(tags[0]);
				i = 1;

			} else if (tags[0].name == 'template') {

				widget_config.template = Lava.parsers.Common.compileTemplate(tags[0].content);
				i = 1;

			}

		}

		// extends must be set before <storage> (required by Lava.parsers.Storage.getMergedStorageSchema())
		if (raw_directive.attributes['extends']) widget_config['extends'] = raw_directive.attributes['extends'];

		for (; i < count; i++) {

			tag = tags[i];
			if (tag.name == 'storage_schema' && is_storage_parsed) Lava.t('Widget definition: `storage_schema` must preceed the `storage` tag');
			if (!(tag.name in this._widget_tag_actions)) Lava.t("Unknown tag in widget definition: " + tag.name + ". Note, that <template> and <view> tags must be on top.");
			this[this._widget_tag_actions[tag.name]](tag, widget_config);
			if (tag.name == 'storage') is_storage_parsed = true;

		}

		if (raw_directive.attributes.controller) {

			path = raw_directive.attributes.controller;
			// example: "$widgetname/ClassName1"
			if (path[0] in Lava.parsers.Common.locator_types) {

				i = path.indexOf('/');
				if (Lava.schema.DEBUG && i == -1) Lava.t("Malformed class name locator: " + path);
				name = path.substr(0, i); // cut the locator part, "$widgetname"
				widget_config.real_class = path.substr(i); // leave the name part: "/ClassName1"
				widget_config.class_locator = {locator_type: Lava.parsers.Common.locator_types[name[0]], name: name.substr(1)};
				if (Lava.schema.DEBUG && (!widget_config.class_locator.name || !widget_config.class_locator.locator_type)) Lava.t("Malformed class name locator: " + path);

			} else {

				widget_config.real_class = raw_directive.attributes.controller;

			}

		}

		if (raw_directive.attributes.label) Lava.parsers.Common.setViewConfigLabel(widget_config, raw_directive.attributes.label);
		if (raw_directive.attributes.id) {
			if (Lava.schema.DEBUG && widget_config.id) Lava.t("[Widget configuration] widget id was already set via main view configuration: " + raw_directive.attributes.id);
			Lava.parsers.Common.setViewConfigId(widget_config, raw_directive.attributes.id);
		}

		if (!widget_config['class']) widget_config['class'] = Lava.schema.widget.DEFAULT_EXTENSION_GATEWAY;
		if (!widget_config.extender_type) widget_config.extender_type = Lava.schema.widget.DEFAULT_EXTENDER;

		this._widget_directives_stack.pop();

		return widget_config;

	}
1363127
function(view, config, widget) {

		var name,
			resource_owner,
			container_resources,
			static_classes,
			static_properties,
			static_styles;

		this._id = Lava.ELEMENT_ID_PREFIX + view.guid;

		this._view = view;
		this._config = config;
		this._widget = widget;
		this._tag_name = config.tag_name;
		this._is_void = Lava.isVoidTag(this._tag_name);

		if (Lava.schema.RESOURCES_ENABLED && config.resource_id) {

			resource_owner = Lava.view_manager.locateTarget(widget, config.resource_id.locator_type, config.resource_id.locator);
			if (Lava.schema.DEBUG && !resource_owner) Lava.t("[Element container] resource owner not found: " + config.resource_id.locator_type + "=" + config.resource_id.locator);
			container_resources = resource_owner.getResource(config.resource_id.name);

		}

		if (Lava.schema.RESOURCES_ENABLED && container_resources) {

			if (Lava.schema.DEBUG && container_resources.type != 'container') Lava.t("Element container: received resource type is not container: " + container_resources.type);
			static_classes = container_resources.value['static_classes'];
			static_properties = container_resources.value['static_properties'];
			static_styles = container_resources.value['static_styles'];

		} else {

			static_classes = config['static_classes'];
			static_properties = config['static_properties'];
			static_styles = config['static_styles'];

		}

		if (Lava.schema.DEBUG && static_properties && ('id' in static_properties))
			Lava.t("Element container: id must not be set via resources or be in config.static_properties");

		// Must clone everything, cause additional statics can be added to the element at run time
		if (static_classes) this._static_classes = static_classes.slice();
		for (name in static_styles) {
			this._static_styles[name] = static_styles[name];
		}
		for (name in static_properties) {
			this._static_properties[name] = static_properties[name];
		}

		for (name in config.events) {
			this._events[name] = Firestorm.clone(config.events[name]); // Object.<string, Array.<_cTarget>>
		}

		this._property_bindings = this._createArguments(config.property_bindings, view, this._onPropertyBindingChanged);
		this._style_bindings = this._createArguments(config.style_bindings, view, this._onStyleBindingChanged);
		// note: class_bindings is also an object. TemplateParser names properties numerically, starting from zero.
		this._class_bindings = this._createArguments(config.class_bindings, view, this._onClassBindingChanged);

		for (name in this._class_bindings) {

			this._class_bindings_values[name] = this._toClassNames(this._class_bindings[name].getValue() || '');

		}

	}
871987
function(config, widget, parent_view, template, properties) {

		var name,
			count,
			i;

		if (Lava.schema.DEBUG && !config.is_extended) Lava.t("Widget was created with partial (unextended) config");

		if (Lava.schema.DEBUG) {
			for (name in this._property_descriptors) {
				if (!(name in this._properties)) Lava.t("All widget properties must have a default value");
			}
			if (config.default_events) {
				for (i = 0, count = config.default_events.length; i < count; i++) {
					if (!Lava.view_manager.isEventRouted(config.default_events[i])) Lava.t('Event is not routed: ' + config.default_events[i]);
				}
			}
		}

		this._parent_widget = widget;

		this.View$init(config, this, parent_view, template, properties);

		for (name in config.bindings) {

			this._bindings[name] = new Lava.scope.Binding(config.bindings[name], this);

		}

	}
664470
function(widget_config, attribute_value, descriptor, name) {

		Lava.store(
			widget_config,
			'options',
			name,
			Lava.ExpressionParser.parse(attribute_value, Lava.ExpressionParser.SEPARATORS.SEMICOLON)
		);

	}
47886
function(config, raw_tag) {

		if (!('assigns' in config)) config.assigns = {};

		if (Lava.schema.DEBUG && !('attributes' in raw_tag)) Lava.t("assign: missing attributes");
		if (Lava.schema.DEBUG && (!raw_tag.content || raw_tag.content.length != 1)) Lava.t("Malformed assign");
		if (raw_tag.attributes.name in config.assigns) Lava.t("Duplicate assign: " + raw_tag.attributes.name);

		var arguments = Lava.ExpressionParser.parse(raw_tag.content[0]);
		if (Lava.schema.DEBUG && arguments.length != 1) Lava.t("Expression block requires exactly one argument");

		if (raw_tag.attributes.once && Lava.types.Boolean.fromString(raw_tag.attributes.once)) {

			arguments[0].once = true;

		}

		config.assigns[raw_tag.attributes.name] = arguments[0];

	}
1115474
function(directive, directiveName, currentFile, variables) {
			if (this._inConditional()) {
				if (!this._isConditional(directiveName)) {
					this.currentConditional.addDirective(directive);
					return {output: ""};
				}
			}

			var attributes = this._parseAttributes(directive);

			function interpolate() {
				for (var i = 0; i < attributes.length; i++) {
					var attribute = attributes[i];
					attribute.name = this._interpolate(attribute.name, variables, false);
					attribute.value = this._interpolate(attribute.value, variables, false);
				}
			}

			switch (directiveName) {
				case "if":
					interpolate.apply(this);
					return this._handleIf(attributes);
				case "elif":
					interpolate.apply(this);
					return this._handleElseIf(attributes);
				case "else":
					interpolate.apply(this);
					return this._handleElse();
				case "endif":
					interpolate.apply(this);
					return this._handleEndIf(currentFile, variables);
				case "set":
					interpolate.apply(this);
					return this._handleSet(attributes);
				case "echo":
					interpolate.apply(this);
					return this._handleEcho(attributes, variables);
				case "include":
					interpolate.apply(this);
					return this._handleInclude(attributes, currentFile, variables);
			}

			return {error: "Could not find parse directive #" + directiveName};
		}