On Mon, Feb 23, 2009 at 6:56 PM, Martín Gaitán <[email protected]> wrote:
>
> Hi people
>
> I'm trying to write a ACP file for SPIP (www.spip.net) template
> language. It uses a pseudo code embeded in HTML to abstract SQL querys
> and PHP.
>
> A basic syntax of a spip's loop looks like this:
>
> <BOUCLE_name(TYPE){criteria 1}{criteria ...}{critiria n}>
> (here should end the cursor)
> </BOUCLE_name>
>
> where name can be any string , TYPE can be one item of a list
> (ARTICLES, FORUMS, DOCUMENTS, etc) and criteria can be also word from
> a list, with the extra requirement that can be one or more.
>
> is it possible to write this set of rules as a acp?
>
> I'm trying to understand the doc and code of others acp files, but I
> really couldn't.
>
> [autostring]
> <bou = "<BOUCLE_${1:name}(${2:TYPE}){${3:criteria}}>\n\t"
>
> - how can I show a popup list of word for TYPE ?
> - its posible add {^! } when user press <tab> recursively in ${3}
> autocomplete?
> - how can I record the name ${1} to close the 'boucle' automatically?
>
>
> thank you in advance for the help.
Here is a acp test file:
[autostring]
<bou = "<BOUCLE_${1:name}(${2:TYPE})${0}\n\t"
[autore]
<(\w+)[^>]*(?<!/)> = \0!^</\1>
[autore_append]
<BOUCLE_[^>]*\(<space> = ARTICLES, FORUMS, DOCUMENTS
<BOUCLE_[^>]*\([^>]*\)[^>]*<space> = {criteria1}, {criteria2}, {criteria3}
Some explanation:
1. First enter "<bou" will insert:
<BOUCLE_name(${2:TYPE})${0}
2. Then you can change "name“ to what you want
3. press tab, will just to "TYPE", when you press blank space key,
it'll pop up a list. But the blank will not be removed, so I don't
know if spip format support spaces?
4. press tab will just to ${0}, then press blank space key, will pop
up criteria list, and still the blank will not be removed, so you just
need to press space is enough.
5. at last, enter '>' will close the tag.
Hope this will help you.
--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliWeb <<simple web framework>>: http://uliwebproject.appspot.com
My Blog: http://hi.baidu.com/limodou