[Lua] Index Extreme, Form.lua

Source: Internet
Author: User

Localform = {_tag='form'}functionForm.build (tag, super)Localtarget = {        _tag=tag,_super=Super} form.spec (target)setmetatable(Target, form.)_meta())    returnTargetEndfunctionForm.on (target, spec)LocalTar = {}     forKvinch Pairs(spec) Do        if type(v) = ='function'  Then            Localmethod = Target[k]orSpec[k] Tar[k]=function ( ... )            Method (target, ...) End        ElseTar[k]=vEnd    End    returnTarEndfunctionForm.spec (target) Target.tag= Target.tagorForm.tagfunctionTarget:on (target)LocalTar = {}        LocalSpec = Self forKvinch Pairs(spec) Do            if type(v) = ='function'  ThenTar[k]=function ( ... )                SPEC[K] (target, ...) End            ElseTar[k]=vEnd        End        Print(Target:tag ():'['.. Spec._tag..'] Target binding form produced')        --no such key binding to the targetTar.on =NilTar.spec=Nil        returnTarEnd    functionTarget:spec (prop, target)ifSelf._interface==Nil  ThenSelf ._interface= {}        End        LocalHandler = {}        functionhandler.string (self, prop, target)ifTarget ~=Nil  Then                Print(Self:tag ():'['.. Prop.'] Setter/getter produced')                Localproperty ='_'.. PropLocal functionprop_ (self, target)ifTarget ~=Nil  ThenSelf[property]=Targetreturn SelfEnd                    returnSelf[property]Endprop_ (self, target) [prop]=Prop_End            LocalSpec =Self[prop] (self)returnSpec andSpec:on (self)End        functionhandler.table (self, prop)Localtarget =propTable.insert(self.)_interface, Target)if type(Target._tag)=='string'  Then                Print(Self:tag ():'interface['.. Target._tag..'] Specified')            End            return SelfEnd        LocalHandler_prop = handler[type(prop)]returnHandler_prop andHandler_prop (self, prop, target)End    returnTargetEndfunctionForm:tag ()Localtag = self._tag    if type(tag) = ='string'     Then        return '*'.. Tag:'*'    End    return 'None. TAG'EndfunctionForm._meta()    LocalMeta = {}    functionMeta.__index (target, key)--avoid target._interface rise to C stack overflow,. etc        --following anonymous table specify the key filters        if({_interface=true,_super=true}) [Key] Then return Nil End        LocalSuper = target._super        Localinterface = target._interface        Localv = Super andSuper[key]ifv = =Nil  and type(interface) = ='Table'         Then             forI=1, #interface Dov=Interface[i][key]ifV ~=Nil  Then returnVEnd            End        End        returnvEnd    returnMetaEndreturnForm

[Lua] Index Extreme, Form.lua

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.