Fixing...this languge I guess?
This commit is contained in:
parent
660501183d
commit
0f4ca0c882
@ -1,33 +1,33 @@
|
|||||||
_alias_map = {}
|
_bem_context = {
|
||||||
_alias_stack = () ()
|
_alias_map: {}
|
||||||
|
_alias_stack: () ()
|
||||||
|
}
|
||||||
|
|
||||||
work_stack(stack, callback)
|
work_stack(stack, callback)
|
||||||
while length(stack) > 0
|
while length(stack) > 0
|
||||||
entry = pop(_alias_stack)
|
entry = pop(stack)
|
||||||
if entry != ()
|
if entry != ()
|
||||||
callback(entry)
|
callback(entry)
|
||||||
|
|
||||||
set_alias(alias, name)
|
set_alias(alias, name)
|
||||||
if name != null && alias != null
|
if name != null && alias != null
|
||||||
_alias_map[alias] = name
|
_bem_context._alias_map[alias] = name
|
||||||
|
|
||||||
lookup_alias(name)
|
lookup_alias(name)
|
||||||
if not _alias_map
|
if name in _bem_context._alias_map
|
||||||
return name
|
return _bem_context._alias_map[name]
|
||||||
if name in _alias_map
|
|
||||||
return _alias_map[name]
|
|
||||||
else
|
else
|
||||||
return name
|
return name
|
||||||
|
|
||||||
store_alias(alias)
|
store_alias(alias)
|
||||||
if alias != null
|
if alias != null
|
||||||
push(_alias_stack, alias)
|
push(_bem_context._alias_stack, alias)
|
||||||
|
|
||||||
pop_last_alias()
|
pop_last_alias()
|
||||||
return pop(_alias_stack)
|
return pop(_bem_context._alias_stack)
|
||||||
|
|
||||||
apply_alias_stack(name)
|
apply_alias_stack(name)
|
||||||
work_stack(_alias_stack, @(element){
|
work_stack(_bem_context._alias_stack, @(element){
|
||||||
set_alias(element, name)
|
set_alias(element, name)
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -66,7 +66,6 @@ RV-Level(name, name_delimiter, allowed_parent_levels, selector_callback)
|
|||||||
not_in_parent = true
|
not_in_parent = true
|
||||||
for parent_level in allowed_parent_levels
|
for parent_level in allowed_parent_levels
|
||||||
not_in_parent = not_in_parent && not_nested_in(parent_level)
|
not_in_parent = not_in_parent && not_nested_in(parent_level)
|
||||||
|
|
||||||
if is_nested_in('RV-Squash') || not_in_parent
|
if is_nested_in('RV-Squash') || not_in_parent
|
||||||
{block}
|
{block}
|
||||||
else if is_nested()
|
else if is_nested()
|
||||||
@ -87,9 +86,9 @@ RV-Block(name)
|
|||||||
.{name}
|
.{name}
|
||||||
+prefix-classes(name)
|
+prefix-classes(name)
|
||||||
{block}
|
{block}
|
||||||
|
|
||||||
define('_alias_map', {}, true)
|
_bem_context._alias_map = {}
|
||||||
define('_alias_stack', () (), true)
|
_bem_context._alias_stack = () ()
|
||||||
|
|
||||||
RV-Element(name=null)
|
RV-Element(name=null)
|
||||||
+RV-Level(name, '__', ('RV-Block' 'RV-Block--modifier'), @(name){
|
+RV-Level(name, '__', ('RV-Block' 'RV-Block--modifier'), @(name){
|
||||||
|
Loading…
Reference in New Issue
Block a user