       child.setAttribute('class', 'hidden')
       # console.log child, attributes, classattributes
 
-      childname = child.localName
-      if childname == 'handler'
-        args = (attributes.args ? '').split()
-        script = htmlDecode(child.innerHTML)
-        type = attributes.type or defaulttype
-        handler = 
-          name: attributes.name
-          script: transformScript(script, type)
-          args: args
-
-        classattributes.$handlers.push(handler)
-        # console.log 'added handler', attributes.name, script, attributes
-      else if childname == 'method'
-        args = (attributes.args ? '').split()
-        script = htmlDecode(child.innerHTML)
-        type = attributes.type or defaulttype
-        classattributes.$methods[attributes.name] = [transformScript(script, type), args]
-        # console.log 'added method', attributes.name, script, classattributes
-      else if childname == 'setter'
-        args = (attributes.args ? '').split()
-        script = htmlDecode(child.innerHTML)
-        type = attributes.type or defaulttype
-        classattributes.$methods['set_' + attributes.name] = [transformScript(script, type), args]
-        # console.log 'added setter', 'set_' + attributes.name, args, classattributes.$methods
-      else if childname == 'attribute'
-        classattributes[attributes.name] = attributes.value
-        classattributes.$types[attributes.name] = attributes.type
-        # console.log 'added attribute', attributes, classattributes
+      switch child.localName
+        when 'handler'
+          args = (attributes.args ? '').split()
+          script = htmlDecode(child.innerHTML)
+          type = attributes.type or defaulttype
+          handler = 
+            name: attributes.name
+            script: transformScript(script, type)
+            args: args
+
+          classattributes.$handlers.push(handler)
+          # console.log 'added handler', attributes.name, script, attributes
+        when 'method'
+          args = (attributes.args ? '').split()
+          script = htmlDecode(child.innerHTML)
+          type = attributes.type or defaulttype
+          classattributes.$methods[attributes.name] = [transformScript(script, type), args]
+          # console.log 'added method', attributes.name, script, classattributes
+        when 'setter'
+          args = (attributes.args ? '').split()
+          script = htmlDecode(child.innerHTML)
+          type = attributes.type or defaulttype
+          classattributes.$methods['set_' + attributes.name] = [transformScript(script, type), args]
+          # console.log 'added setter', 'set_' + attributes.name, args, classattributes.$methods
+        when 'attribute'
+          classattributes[attributes.name] = attributes.value
+          classattributes.$types[attributes.name] = attributes.type
+          # console.log 'added attribute', attributes, classattributes
+
+    # console.log('processSpecialTags', classattributes)
     return 
 
 

    writeDefaultStyle: writeDefaultStyle
  }

lz.writeDefaultStyle()
$(window).on('load', () -> 
  lz.initViews() 


  # generate a callback for an event expression in a way that preserves scope, e.g. on_x="console.log(value, this, ...)"
  eventCallback = (name, script, scope, fnargs=['value']) ->
    # console.log 'binding to event expression', name, script, scope, fnargs
    js = compileScript(script, fnargs)
    () ->
      if name of scope
        args = [scope[name]]
      else 
        args = arguments
        # console.log 'event callback', name, args, scope, js
        js.apply(scope, args)


