1. ActionScript / Говнокод #9750

    −124

    1. 01
    2. 02
    3. 03
    4. 04
    5. 05
    6. 06
    7. 07
    8. 08
    9. 09
    10. 10
    11. 11
    12. 12
    13. 13
    14. 14
    15. 15
    16. 16
    17. 17
    18. 18
    19. 19
    20. 20
    21. 21
    22. 22
    23. 23
    24. 24
    25. 25
    26. 26
    27. 27
    28. 28
    29. 29
    30. 30
    31. 31
    32. 32
    33. 33
    34. 34
    35. 35
    36. 36
    37. 37
    38. 38
    39. 39
    40. 40
    41. 41
    42. 42
    43. 43
    44. 44
    45. 45
    46. 46
    47. 47
    if (param.visible == 'cache')
    {
    	while (parseCacheResult.indexOf('$data') != -1) parseCacheResult = parseCacheResult.replace('$data', '_dataCache');
    	while (parseCacheResult.indexOf('$name') != -1) parseCacheResult = parseCacheResult.replace('$name', param.nameParam);
    	while (parseCacheResult.indexOf('$type') != -1) parseCacheResult = parseCacheResult.replace('$type', param.type);
    } else if (param.visible == 'static')
    {
    	while (parseStaticResult.indexOf('$data') != -1) parseStaticResult = parseStaticResult.replace('$data', '_dataStatic');
    	while (parseStaticResult.indexOf('$name') != -1) parseStaticResult = parseStaticResult.replace('$name', param.nameParam);
    	while (parseStaticResult.indexOf('$type') != -1) parseStaticResult = parseStaticResult.replace('$type', param.type);
    }
    else
    {
    	while (parseDynamicResult.indexOf('$data') != -1) parseDynamicResult = parseDynamicResult.replace('$data', '_dataDynamic');
    	while (parseDynamicResult.indexOf('$name') != -1) parseDynamicResult = parseDynamicResult.replace('$name', param.nameParam);
    	while (parseDynamicResult.indexOf('$type') != -1) parseDynamicResult = parseDynamicResult.replace('$type', param.type);
    }
    
    while (setResult.indexOf('$name') != -1) setResult = setResult.replace('$name', param.nameParam);
    while (setResult.indexOf('$type') != -1) setResult = setResult.replace('$type', param.type);
    while (setResult.indexOf('$className') != -1) setResult = setResult.replace('$className', className);
    
    while (getResult.indexOf('$name') != -1) getResult = getResult.replace('$name', param.nameParam);
    while (getResult.indexOf('$type') != -1) getResult = getResult.replace('$type', param.type);
    
    while (varResult.indexOf('$name') != -1) varResult = varResult.replace('$name', param.nameParam);
    while (varResult.indexOf('$type') != -1) varResult = varResult.replace('$type', param.type);
    while (varResult.indexOf('$comment') != -1) varResult = varResult.replace('$comment', param.comment);
    while (varResult.indexOf('$default') != -1) varResult = varResult.replace('$default', param.defaultValue);
    
    }
    
    var result : String = baseTemplate;
    while (result.indexOf('$className') != -1) result = result.replace('$className', className);
    while (result.indexOf('$comment') != -1) result = result.replace('$comment', comment);
    while (result.indexOf('$baseClass') != -1) result = result.replace('$baseClass', baseClass);
    while (result.indexOf('$singleton_1') != -1) result = result.replace('$singleton_1', singl_1);
    while (result.indexOf('$singleton_2') != -1) result = result.replace('$singleton_2', singl_2);
    
    result = result.replace('$var', varResult);
    result = result.replace('$set', setResult);
    result = result.replace('$get', getResult);
    result = result.replace('$parseDynamic', parseDynamicResult);
    result = result.replace('$parseStatic', parseStaticResult);
    result = result.replace('$parseCache', parseCacheResult);
    result = result.replace('$values', valuesList);
    result = result.replace('$dynamic', data.dynamicClass == 1 ? 'dynamic' : '');

    Как то родилось в процессе допилок кодогена )

    Запостил: kyzi007, 23 Марта 2012

    Комментарии (1) RSS

    Добавить комментарий