lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Mr Parke,

Will the following work for  you?
> grammar  =  [==
> [ wikitext  <-  {|  ( link / separator / text )*  |}
> link  <-  {|
> {:t:''->'link':}
> {'[['}
> !':'
> ''->'Name::'
> {       (  !']]'  !'|'  .  )+  }
>{  '|'  (  !']]' .  )*  /  }
>{']]'}
> |} separator  <-  {|
> {:t:''->'separator':}
> { [,;*#] }
> { %s* }
>|}
> text  <-  {|
> {:t:''->'text':}
> {  (  !link !separator  .  )+ }
>|}
> ]==]
Unfortunately, not. The grammar splits the input line into chunks, which have to be re-concatenated to get what I wanted as 'full' field. Iwas able to achieve it in a simpler form but hoped to avoid this second step. In addition, 'Name::' is not inserted, although with this chunked input this is not necessary.

Thank you for your help anyway.

Alexander Mashin