Re: [Pharo-users] Help Petit Parse

2018-03-13 Thread Pau Guillot
Thank you both, Pau



--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html



Re: [Pharo-users] Help Petit Parse

2018-03-13 Thread Tudor Girba
That is indeed the solution.

Doru


> On Mar 13, 2018, at 6:16 AM, Holger Freyther  wrote:
> 
> 
> 
>> On 12. Mar 2018, at 23:07, Pau Guillot  wrote:
>> 
>> (#word asParser , #digit asParser plus flatten ==> [:node | node second])
>> star parse: 'A123A123'. 
>> -> #('123' '123')
> 
> (((#word asParser , #digit asParser plus flatten ==> [:node | node second]) 
> plus) ==> [ :node  | '' join: node]) parse: 'a123a123'
> => '123123'
> 
> probably there is a nicer way. ;)

--
www.tudorgirba.com
www.feenk.com 

“Live like you mean it."




Re: [Pharo-users] Help Petit Parse

2018-03-12 Thread Holger Freyther


> On 12. Mar 2018, at 23:07, Pau Guillot  wrote:
> 
> (#word asParser , #digit asParser plus flatten ==> [:node | node second])
> star parse: 'A123A123'. 
> -> #('123' '123')

(((#word asParser , #digit asParser plus flatten ==> [:node | node second]) 
plus) ==> [ :node  | '' join: node]) parse: 'a123a123'
=> '123123'

probably there is a nicer way. ;)


[Pharo-users] Help Petit Parse

2018-03-12 Thread Pau Guillot
Hello,
I can not manage this syntax that seems to be simple.

MyParser parse: 'A123A123'  -> '123123'
not: #('123' '123')

(#word asParser , #digit asParser plus flatten ==> [:node | node second])
star parse: 'A123A123'. 
-> #('123' '123')

(#word asParser , #digit asParser plus flatten ==> [:node | node second])
star flatten parse: 'A123A123'. -> 'A123A123'


Thank you.




--
Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html