<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;"><div>Hi Levente,<br></div><div><br></div><div>Thank you for your reply.<br></div><div><br></div><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div><div>That makes no sense. I can't even fathom how it works. <br></div><div>#inject:into:'s second argument, the block, must return the computed <br></div><div>value. <br></div><div>Currently that block returns the value assigned to base when pair first = <br></div><div>'e' and nil otherwise. <br></div><div>So, if it works correctly now, which is doubtful, then just remove the <br></div><div>assignments to base from the block and it should just work.<br></div></div></blockquote><div>I did, it does. thx.<br></div><div><br></div><div>Fwiw, here are the tests I have for this rule ...It might make things clearer on what it is meant to accomplish.  The pattern is borrowed from some Algebraic PEG grammar I found on the net.<br></div><div>The purpose is to support some PHP-isms in the wikitext grammar...basically PHP version of callbacks given a pattern.</div><div><br></div><div><blockquote style="border: 1px solid rgb(204, 204, 204); padding: 7px; background-color: rgb(245, 245, 245);"><div>testFloat<br></div><div><br></div><div><timeout: 5 "seconds"><br></div><div><br></div><div>"Float                                            <-  Multiplicand  (''e'' Multiplicand)+"<br></div><div>| n output actor |<br></div><div><br></div><div>actor := PEGWikiMediaGeneratorTables new.<br></div><div>actor transcripton: false.  "disable tracing to Transcript"<br></div><div><br></div><div>n := '-2.3e-4'.<br></div><div>output := parser parse: 'Negation' stream: n reading actor: actor.<br></div><div>self assert: (output =  -0.00023 ).<br></div><div><br></div><div>n := '6e2e3'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output = 600000.0) .<br></div><div><br></div><div><br></div><div>n := '2e3'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output = 2000) .<br></div><div><br></div><div><br></div><div>n := '-2.3e-4'.<br></div><div>output := parser parse: 'Negation' stream: n reading actor: actor.<br></div><div>self assert: (output =  -0.00023 ).<br></div><div><br></div><div><br></div><div><br></div><div><br></div><div>n := '(trunc2)e(trunc-3)'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output =       0.002) .<br></div><div><br></div><div><br></div><div>n := '(trunc2)e(trunc0)'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output =     2) .<br></div><div><br></div><div>n := '(trunc2)e(trunc18)'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor. <br></div><div>self assert: (output = 2.0e18) .<br></div><div><br></div><div>n := '(trunc2)e(trunc19)'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output = 2.0e19) .<br></div><div><br></div><div>n := '6e(5-2)'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output = 6000.0) .<br></div><div><br></div><div>n := '(5-2)e-2'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output = 0.03) .<br></div><div><br></div><div><br></div><div>n := '6e(5-2)e-2'.<br></div><div>output := parser parse: 'Float' stream: n reading actor: actor.<br></div><div>self assert: (output = 60) .<br></div><div><br></div><div><br></div><div>n := '5.0e-324'.  "(Float fmin) * (Float fmax)"<br></div><div>output := parser parse: 'Operation' stream: n reading actor: actor.<br></div><div>self assert: (output = (Float fmin) ) .<br></div></blockquote><br></div><div><br></div></div><br></body></html>