Check-in [a356076104]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[bb7eb5d898] Changed the demo app code to use the new static Parse method.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a356076104b81faf39142cd3808fb33e7f455e89
User & Date: adamc 2016-11-13 14:26:04
Context
2016-11-13
14:52
[a7c9cfbcda] Made changes to CSS and TS to implement. check-in: 268cdcdf71 user: adamc tags: trunk
14:26
[bb7eb5d898] Changed the demo app code to use the new static Parse method. check-in: a356076104 user: adamc tags: trunk
14:13
[4c607651cb] Added code and tests to give ParserSet the Parse method. check-in: 99e17d1f46 user: adamc tags: trunk
Changes

Changes to app/chattymath.ts.

   270    270               pcomb.opt(pcomb.or([pcomb.lit("="), pcomb.lit("equal")]))]);
   271    271   
   272    272           this.parsers = new pcomb.ParserSet(new ChattyInput(), new ChattyData());
   273    273       }
   274    274   
   275    275       ask(text: string): string {
   276    276           let theAnswer = "sorry, but I couldn't understand that";
   277         -        let parseResult = this.parsers.parse(this.formulaParser, text);
          277  +        let parseResult = pcomb.Parse(this.formulaParser, text, new ChattyInput(), new ChattyData());
   278    278           if (parseResult[0]) {
   279    279               let calc: number = NaN;
   280    280               let theData: ChattyData = <ChattyData>parseResult[2];
   281    281   
   282    282               switch (theData.operator) {
   283    283                   case MathOps.Add:
   284    284                       calc = theData.leftOperand + theData.rightOperand;