fix the usage of definedInScope in pegs.=~
fix the usage of definedInScope in pegs.=~

template `=~`*(s: string, pattern: TPeg): bool =
   when not definedInScope(matches):
      var matches: array[0..maxSubpatterns-1, string]

It seems that this never worked as intended.
I discovered it now, because when variables' names are preserved, multiple
variables named `matches` were created. The reason this happens is that
when the template is used as an if condition, the if scope is already entered,
but the variables end up in the outer scope.

This patch is consistent with how `expr` templates work, but makes the
definition of a variable injection template like := a bit harder, yet still possible.
(note that if foo := bar(): is still not creating properly scoped variable prior to the patch)

nafsaka/Nim,JCavallo/Nim,SSPkrolik/Nim,bvssvni/Nim,fredericksilva/Nim,nanoant/Nim,jfhg/Nim,msmith491/Nim,sferik/Nim,fredericksilva/Nim,MrJohz/Nim,kirbyfan64/Nim,haiodo/Nim,Salafit/Nim,SSPkrolik/Nim,JCavallo/Nim,msmith491/Nim,douglas-larocca/Nim,gokr/Nim,reactormonk/nim,fredericksilva/Nim,greyanubis/Nim,fmamud/Nim,gokr/Nim,xland/Nim,msmith491/Nim,Senketsu/Nim,Dhertz/Nim,msmith491/Nim,jsanjuas/Nim,Salafit/Nim,jfhg/Nim,BlaXpirit/nim,tulayang/Nim,SSPkrolik/Nim,MrJohz/Nim,nafsaka/Nim,kirbyfan64/Nim,nafsaka/Nim,tulayang/Nim,xland/Nim,dom96/Nim,nafsaka/Nim,sarvex/Nim-lang,haiodo/Nim,haiodo/Nim,endragor/Nim,dom96/Nim,fmamud/Nim,kirbyfan64/Nim,fmamud/Nim,zachaysan/Nim,singularperturbation/Nim,sferik/Nim,BlaXpirit/nim,mbaulch/Nim,sarvex/Nim-lang,singularperturbation/Nim,msmith491/Nim,tmm1/Nim,russpowers/Nim,Matt14916/Nim,BlaXpirit/nim,tmm1/Nim,douglas-larocca/Nim,russpowers/Nim,russpowers/Nim,fredericksilva/Nim,JCavallo/Nim,BlaXpirit/nim,tmm1/Nim,Senketsu/Nim,MrJohz/Nim,Matt14916/Nim,Salafit/Nim,mbaulch/Nim,SSPkrolik/Nim,mbaulch/Nim,MrJohz/Nim,bvssvni/Nim,haiodo/Nim,mbaulch/Nim,sferik/Nim,MrJohz/Nim,kirbyfan64/Nim,jsanjuas/Nim,nimLuckyBull/Nim,jfhg/Nim,judofyr/Nim,BlaXpirit/nim,fredericksilva/Nim,fredericksilva/Nim,bvssvni/Nim,singularperturbation/Nim,dom96/Nim,nanoant/Nim,nimLuckyBull/Nim,Matt14916/Nim,douglas-larocca/Nim,kirbyfan64/Nim,nafsaka/Nim,fredericksilva/Nim,MrJohz/Nim,singularperturbation/Nim,gokr/Nim,dom96/Nim,bvssvni/Nim,bvssvni/Nim,haiodo/Nim,JCavallo/Nim,Matt14916/Nim,zachaysan/Nim,nimLuckyBull/Nim,jsanjuas/Nim,sferik/Nim,nanoant/Nim,jsanjuas/Nim,dom96/Nim,tmm1/Nim,reactormonk/nim,tulayang/Nim,kirbyfan64/Nim,Senketsu/Nim,russpowers/Nim,judofyr/Nim,jfhg/Nim,zachaysan/Nim,sferik/Nim,jfhg/Nim,greyanubis/Nim,jsanjuas/Nim,gokr/Nim,fmamud/Nim,dom96/Nim,greyanubis/Nim,endragor/Nim,sarvex/Nim-lang,kirbyfan64/Nim,Dhertz/Nim,BlaXpirit/nim,bvssvni/Nim,JCavallo/Nim,zachaysan/Nim,tmm1/Nim,nafsaka/Nim,sarvex/Nim-lang,nafsaka/Nim,msmith491/Nim,greyanubis/Nim,greyanubis/Nim,douglas-larocca/Nim,reactormonk/nim,nanoant/Nim,reactormonk/nim,Dhertz/Nim,xland/Nim,reactormonk/nim,gokr/Nim,xland/Nim,tmm1/Nim,nanoant/Nim,haiodo/Nim,singularperturbation/Nim,reactormonk/nim,fredericksilva/Nim,tulayang/Nim,sarvex/Nim-lang,dom96/Nim,nimLuckyBull/Nim,gokr/Nim,singularperturbation/Nim,greyanubis/Nim,xland/Nim,fmamud/Nim,Senketsu/Nim,nimLuckyBull/Nim,sferik/Nim,JCavallo/Nim,endragor/Nim,reactormonk/nim,fmamud/Nim,greyanubis/Nim,nanoant/Nim,douglas-larocca/Nim,judofyr/Nim,mbaulch/Nim,Dhertz/Nim,sferik/Nim,judofyr/Nim,gokr/Nim,bvssvni/Nim,zachaysan/Nim,sferik/Nim,endragor/Nim,Salafit/Nim,Dhertz/Nim,Matt14916/Nim,tulayang/Nim,Senketsu/Nim,jsanjuas/Nim,JCavallo/Nim,jsanjuas/Nim,jfhg/Nim,nanoant/Nim,mbaulch/Nim,msmith491/Nim,jfhg/Nim,reactormonk/nim,gokr/Nim,Senketsu/Nim,russpowers/Nim,SSPkrolik/Nim,douglas-larocca/Nim,tulayang/Nim,zachaysan/Nim,xland/Nim,BlaXpirit/nim,Salafit/Nim,endragor/Nim,SSPkrolik/Nim,SSPkrolik/Nim,Matt14916/Nim,nimLuckyBull/Nim,russpowers/Nim,haiodo/Nim,singularperturbation/Nim,Salafit/Nim,zachaysan/Nim,douglas-larocca/Nim,mbaulch/Nim,Matt14916/Nim,judofyr/Nim,MrJohz/Nim,xland/Nim,sarvex/Nim-lang,judofyr/Nim,endragor/Nim,Senketsu/Nim,kirbyfan64/Nim,SSPkrolik/Nim,douglas-larocca/Nim,BlaXpirit/nim,Dhertz/Nim,judofyr/Nim,Dhertz/Nim,russpowers/Nim,sarvex/Nim-lang,judofyr/Nim,fmamud/Nim,Salafit/Nim,tmm1/Nim,nimLuckyBull/Nim,endragor/Nim