Changeset 9

Show
Ignore:
Timestamp:
10/21/05 17:19:22 (3 years ago)
Author:
Jan-Klaas Kollhof
Message:

another useless comment

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • jsolait/trunk/jsolait/jsolait.js

    r8 r9  
    560560         
    561561        specifier([...]-items are optional):  
    562             "%(key)[flag][sign][min][percision]typeOfValue" 
     562            "%[(key)][flag][sign][min][percision]typeOfValue" 
    563563             
    564564            (key)  If specified the 1st argument is treated as an object/associative array and the formating values  
     
    758758        } 
    759759        return out.join('\n'); 
    760     } 
     760    }; 
    761761     
    762762    ///Tests the module. 
  • jsolait/trunk/jsolait/lib/codecs.js

    r5 r9  
    157157 
    158158    /** 
    159         Decodes a URI using decodeURI
     159        Decodes a URI using decodeURIComponent
    160160    **/ 
    161161    String.prototype.decode_uri=function(){ 
    162         return decodeURI(this); 
     162        return decodeURIComponent(this); 
    163163    }; 
    164164     
    165165    /** 
    166         Encodes a URI using encodeURI
     166        Encodes a URI using encodeURIComponent
    167167    **/ 
    168168    String.prototype.encode_uri=function(){ 
    169         return encodeURI(this); 
     169        return encodeURIComponent(this); 
    170170    }; 
    171171}); 
  • jsolait/trunk/jsolait/lib/lang.js

    r8 r9  
    2020 
    2121/** 
    22     Module providing language services like tokenizing JavaScript code 
    23     or converting JavaScript objects to and from JSON (see json.org). 
    24     To customize JSON serialization of Objects just overwrite the toJSON method in your class. 
     22    Module providing language services like tokenizing and parsing JavaScript code. 
     23     
    2524    @creator                 Jan-Klaas Kollhof 
    2625    @created                2004-03-14 
     
    305304            } 
    306305        }; 
    307          
    308          
    309          
    310306    }); 
    311      
    312      
    313      
    314     mod.ModuleNode=Class(function(publ,supr){ 
    315         publ.__init__=function(script){ 
    316             this.script=script; 
    317         }; 
    318          
    319         publ.parse=function(){ 
    320              
    321         }; 
    322     }); 
    323      
    324      
     307         
    325308    mod.CodeNode=Class(function(publ,supr){ 
    326309        publ.__init__=function(){ 
     
    603586                 
    604587                this.currentNode.version = tkn.value.slice(1,-1); 
    605                 this.currentNode.documentation = this.getDocumentation(); 
     588                this.currentNode.description = this.getDocumentation(); 
    606589                             
    607590                tkn=this.nextNonWhiteSpaceExpect(','); 
     
    667650         
    668651        publ.parseStatement_mod=function(tkn){ 
    669             return this.parseStatement_publProp(tkn); 
     652            if(this.currentNode instanceof mod.ModuleNode){ 
     653                return this.parseStatement_publProp(tkn); 
     654            }else{ 
     655                tkn = this.parseExpression(tkn); 
     656                return this.parseEndOfStatement(tkn); 
     657            } 
    670658        }; 
    671659         
     
    687675                        this.currentNode = this.currentNode.addPublic(new mod.MethodNode()); 
    688676                        this.currentNode.name = name; 
    689                         this.currentNode.documentation = this.getDocumentation(); 
     677                        this.currentNode.description = this.getDocumentation(); 
    690678                        tkn = this.parseExpression_function(tkn); 
    691679                        break; 
     
    693681                        this.currentNode = this.currentNode.addPublic(new mod.ClassNode()); 
    694682                        this.currentNode.name = name; 
    695                         this.currentNode.documentation = this.getDocumentation(); 
     683                        this.currentNode.description = this.getDocumentation(); 
    696684                        tkn = this.parseExpression_Class(tkn); 
    697685                        break; 
     
    699687                        this.currentNode = this.currentNode.addPublic(new mod.PropertyNode()); 
    700688                        this.currentNode.name = name; 
    701                         this.currentNode.documentation = this.getDocumentation(); 
     689                        this.currentNode.description = this.getDocumentation(); 
    702690                        tkn = this.parseExpression(tkn); 
    703691                } 
     
    705693                this.currentNode = this.currentNode.addPublic(new mod.PropertyNode()); 
    706694                this.currentNode.name = name; 
    707                 this.currentNode.documentation = this.getDocumentation(); 
     695                this.currentNode.description = this.getDocumentation(); 
    708696            } 
    709697             
     
    10751063            pprint('<module>',4); 
    10761064            pprint('<name>'+n.name+'</name>'); 
    1077             pprint('<documentation>', 4); 
    1078             pprint(n.documentation); 
    1079             pprint('</documentation>', -4); 
     1065            pprint('<description>', 4); 
     1066            pprint(n.description); 
     1067            pprint('</description>', -4); 
    10801068            pprint('<dependencies>'+n.dependencies+'</dependencies>'); 
    10811069             
     
    10891077            pprint('<name>'+n.name+'</name>'); 
    10901078             
    1091             pprint('<documentation>', 4); 
    1092             pprint(n.documentation); 
    1093             pprint('</documentation>', -4); 
     1079            pprint('<description>', 4); 
     1080            pprint(n.description); 
     1081            pprint('</description>', -4); 
    10941082             
    10951083            this.printPublics(n); 
     
    11461134            pprint('<property>',4); 
    11471135            pprint('<name>' + n.name + '</name>'); 
    1148             pprint('<documentation>', 4); 
    1149             pprint(n.documentation); 
    1150             pprint('</documentation>', -4); 
     1136            pprint('<description>', 4); 
     1137            pprint(n.description); 
     1138            pprint('</description>', -4); 
    11511139            pprint('</property>',-4); 
    11521140             
     
    11561144            pprint('<method>',4); 
    11571145            pprint('<name>' + n.name + '(' + n.parameters.join(', ') +  ')</name>'); 
    1158             pprint('<documentation>', 4); 
    1159             pprint(n.documentation); 
    1160             pprint('</documentation>', -4); 
     1146            pprint('<description>', 4); 
     1147            pprint(n.description); 
     1148            pprint('</description>', -4); 
    11611149            pprint('</method>',-4); 
    11621150        }; 
     
    11661154    mod.__main__=function(){ 
    11671155        //var s='switch(a){\n case "as":\n\na=2;\nbreak;case "df":\nbreak;   } a.'; 
    1168         var it =imprt('iter'); 
     1156        var it=imprt('iter'); 
     1157        var c= imprt('codecs'); 
     1158         
    11691159        var filenames= ['jsolait.js',  
    11701160                'lib/codecs.js',   
     
    11861176            fname=jsolait.baseURI + '/' + fname; 
    11871177            var s = jsolait.loadURI(fname); 
     1178           print(s.encode('uri')); 
    11881179         
    11891180            var p = new mod.Parser(s, gn); 
     
    11931184            }catch(e){ 
    11941185                var l=p.getPosition(); 
    1195                 throw fname.slice('file://'.length) + '(' + (l[0] ) + ',' +l[1] + ') ' +   e + ' near:\n' + p._working.slice(0,200); 
     1186                throw new mod.Exception(fname.slice('file://'.length) + '(' + (l[0] ) + ',' +l[1] + ') ' +   e + ' near:\n' + p._working.slice(0,200)); 
    11961187            }  
    11971188        }); 
  • jsolait/trunk/jsolait/lib/sets.js

    r8 r9  
    335335        print(testing.test(function(){ 
    336336            testing.assertEquals("checking %s | %s".format(s1, s2),  
    337                                         new mod.Set("0123456789"), s1.union(s2)) 
     337                                        new mod.Set("0123456789"), s1.union(s2)); 
    338338             
    339339            testing.assertEquals("checking %s | %s".format(s2, s1), 
     
    357357            testing.assertEquals("checking %s ^ %s".format(s2, s1), 
    358358                                        new mod.Set("012789"),s2.symmDifference(s1)); 
    359         })) 
     359        })); 
    360360    }; 
    361361}); 
  • jsolait/trunk/jsolait/lib/testing.js

    r8 r9  
    5050        publ.__init__=function(testScope){ 
    5151            this.testScope=testScope; 
    52         } 
     52        }; 
    5353         
    5454        publ.run=function(){ 
     
    6565            this.endTime=(new Date()).getTime(); 
    6666            this.duration=this.endTime-this.startTime; 
    67         } 
     67        }; 
    6868         
    6969        publ.report=function(){ 
     
    7373                return "Test completed in %s ms".format(this.duration); 
    7474            } 
    75         } 
     75        }; 
    7676         
    7777        publ.startTime; 
     
    9191            this.comment = comment; 
    9292            supr.__init__.call(this, "%s failed: %s".format(comment, failMsg)); 
    93         } 
     93        }; 
    9494    }); 
    9595     
     
    104104            throw new mod.AssertFailed(comment, failMsg===undefined ? "Expected true but found: %s".format(value) : failMsg); 
    105105        } 
    106     } 
     106    }; 
    107107     
    108108    mod.assertTrue=function(comment, value){ 
     
    112112        } 
    113113        mod.assert(comment, value===true, "Expected true but found: %s".format(value));             
    114     } 
     114    }; 
    115115     
    116116    mod.assertFalse=function(comment, value){ 
     
    120120        } 
    121121        mod.assert(comment, value===false, "Expected false but found: %s".format(value));             
    122     } 
     122    }; 
    123123     
    124124    mod.assertEquals=function(comment, value1, value2){ 
     
    133133            mod.assert(comment, value1  === value2, "Expected %s === %s.".format(value1, value2));             
    134134        } 
    135     } 
     135    }; 
    136136     
    137137    mod.assertNotEquals=function(comment, value1, value2){ 
     
    146146            mod.assert(comment, value1  !== value2, "Expected %s !== %s.".format(value1, value2));             
    147147        } 
    148     } 
     148    }; 
    149149     
    150150    mod.assertNull=function(comment, value){ 
     
    154154        } 
    155155        mod.assert(comment, value===null, "Expected %s === null.".format(value)); 
    156     } 
     156    }; 
    157157     
    158158    mod.assertNotNull=function(comment, value){ 
     
    162162        } 
    163163        mod.assert(comment, value !==null, "Expected %s !== null.".format(value)); 
    164     } 
     164    }; 
    165165     
    166166    mod.assertUndefined=function(comment, value){ 
     
    170170        } 
    171171        mod.assert(comment, value===undefined, "Expected %s === undefined.".format(value)); 
    172     } 
     172    }; 
    173173     
    174174    mod.assertNotUndefined=function(comment, value){ 
     
    178178        } 
    179179        mod.assert(comment, value!==undefined, "Expected %s !== undefined".format(value)); 
    180     } 
     180    }; 
    181181     
    182182    mod.assertNaN=function(comment, value){ 
     
    186186        } 
    187187        mod.assert(comment, isNaN(value)===true, "Expected %s === NaN.".format(value)); 
    188     } 
     188    }; 
    189189     
    190190    mod.assertNotNaN=function(comment, value){ 
     
    194194        } 
    195195        mod.assert(comment, isNaN(value)!==true, "Expected %s !== NaN".format(value)); 
    196     } 
     196    }; 
    197197     
    198198    mod.fail=function(){ 
    199199         
    200     } 
     200    }; 
    201201         
    202202    mod.objectKeys=function(obj){ 
     
    231231            mod.assertNotEquals(mod,{}); 
    232232        })); 
    233     } 
     233    }; 
    234234}); 
    235235