On 12/15/2012 2:10 AM, Andre Caldas wrote:
Hello, Hans!

I had just managed to do it. I will switch to yours instead of mine...
I don't have any experience in Lua. Sorry for bothering with such easy
requests...

As ranges are sometimes handy I've added a parser to the core (no upload yet, will happen sometime next week)

-- utilities.parsers.stepper("1,3-",5,function(i) print(">>>",i) end)
-- utilities.parsers.stepper("1-3,6,7")
-- utilities.parsers.stepper("1-3,6,7",function(i) print(">>>",i) end)
-- utilities.parsers.stepper("1:3,6,7")
-- utilities.parsers.stepper(" 1 : 3, ,7 ")
-- utilities.parsers.stepper("1-2,5-6,25-*",30)

So:

- * as optional final value symbol
- optional spaces around : and, and around list
- - as well as :

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to