Loading ...
Sorry, an error occurred while loading the content.

[Cheetahtemplate-discuss] Lexical problem ?

Expand Messages
  • Jean-Luc Corre
    I try these 2 files : -- ok.tmpl #def func ($x) See $x #end def $func( foo ) -- ko.tmpl #def func($x) See $x #end def $func ( foo ) ok.tmpl is OK : * Note 1:
    Message 1 of 3 , Aug 4, 2006
    • 0 Attachment
      Lexical problem ?

      I try these 2 files :

      -- ok.tmpl
      #def func ($x)
      See $x
      #end def
      $func('foo')

      -- ko.tmpl
      #def func($x)
      See $x
      #end def
      $func ('foo')

      ok.tmpl is OK :
      * Note 1: one space between -#def func- and -($x)-
      * Note 2: no space between -$func- and -('foo')-

      ko.tmpl is NOT OK :
      * the space between -$func- and -('foo')- is the apparent lexical problem.

      I made the test on :
      - Win32 +  Python 2.4.2 +  Cheetah 2.0rc7,
      - Cygwin 1.5 +  Python 2.4.3 + Cheetah 1.0.

      Thanks,
      Jean-Luc

    • Mike Orr
      ... That s a feature. The space ends the placeholder, as does any other character not in [A-Za-z0-9_.()[]]. You can use the long form to explicitly delimit
      Message 2 of 3 , Aug 4, 2006
      • 0 Attachment
        On 8/4/06, Jean-Luc Corre <jean-luc.corre@...> wrote:
        >
        >
        >
        > I try these 2 files :
        >
        > -- ok.tmpl
        > #def func ($x)
        > See $x
        > #end def
        > $func('foo')
        >
        > -- ko.tmpl
        > #def func($x)
        > See $x
        > #end def
        > $func ('foo')
        >
        > ok.tmpl is OK :
        > * Note 1: one space between -#def func- and -($x)-
        > * Note 2: no space between -$func- and -('foo')-
        >
        > ko.tmpl is NOT OK :
        > * the space between -$func- and -('foo')- is the apparent lexical problem.

        That's a feature. The space ends the placeholder, as does any other
        character not in [A-Za-z0-9_.()[]]. You can use the long form to
        explicitly delimit the placeholder: ${func ('foo')}, but that will
        probably reject the space too.

        The syntax for #directives is more lenient so more spaces might be allowed.

        --
        Mike Orr <sluggoster@...>

        -------------------------------------------------------------------------
        Take Surveys. Earn Cash. Influence the Future of IT
        Join SourceForge.net's Techsay panel and you'll get the chance to share your
        opinions on IT & business topics through brief surveys -- and earn cash
        http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      • Shannon -jj Behrens
        ... I agree with Mike. By the way, the Python style guide says that there should not be a space between the function name and the parameters. Hence, I don t
        Message 3 of 3 , Aug 4, 2006
        • 0 Attachment
          On 8/4/06, Mike Orr <sluggoster@...> wrote:
          > On 8/4/06, Jean-Luc Corre <jean-luc.corre@...> wrote:
          > >
          > >
          > >
          > > I try these 2 files :
          > >
          > > -- ok.tmpl
          > > #def func ($x)
          > > See $x
          > > #end def
          > > $func('foo')
          > >
          > > -- ko.tmpl
          > > #def func($x)
          > > See $x
          > > #end def
          > > $func ('foo')
          > >
          > > ok.tmpl is OK :
          > > * Note 1: one space between -#def func- and -($x)-
          > > * Note 2: no space between -$func- and -('foo')-
          > >
          > > ko.tmpl is NOT OK :
          > > * the space between -$func- and -('foo')- is the apparent lexical problem.
          >
          > That's a feature. The space ends the placeholder, as does any other
          > character not in [A-Za-z0-9_.()[]]. You can use the long form to
          > explicitly delimit the placeholder: ${func ('foo')}, but that will
          > probably reject the space too.
          >
          > The syntax for #directives is more lenient so more spaces might be allowed.

          I agree with Mike. By the way, the Python style guide says that there
          should not be a space between the function name and the parameters.
          Hence, I don't think it's necessary to make Cheetah any more lenient.

          -jj

          -------------------------------------------------------------------------
          Take Surveys. Earn Cash. Influence the Future of IT
          Join SourceForge.net's Techsay panel and you'll get the chance to share your
          opinions on IT & business topics through brief surveys -- and earn cash
          http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
          _______________________________________________
          Cheetahtemplate-discuss mailing list
          Cheetahtemplate-discuss@...
          https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
        Your message has been successfully submitted and would be delivered to recipients shortly.