Re: SMEL heredoc syntax ATTEN: tommy
- Posted by Isaac Raway <isaac-topica at blueapples.org> Jan 06, 2004
- 365 views
Tommy, Looks great. One thing I'd recommend, however, is that the identifier be required to be on it's own line. Basically, that means that only \n\rEND_OF_CODE;\n\r or \nEND_OF_CODE;\n will terminate the syntax. That way, END_OF_CODE could appear in the string if it really has too (which is always possible, especially because END is a common heredoc keyword which also happens to be a common keyword in code). It also just occurred to me that with this addition, SMEL could actually be used as the basis of an entire application. The visual objects (form and controls) could be expressed as SMEL, with Euphoria (or any other language for that matter) attached with the $END...END; syntax.... Hmmm...interesting. Also, thank you for adding this feature without too much pushing. I like people who take suggestions. Isaac Tommy Carlier wrote: > > I have added the HereDocText-construction to SMEL. To implement it, > you have to use a $, followed by an identifier (starts with a letter, > and only contains letters, numbers, _ and -). > > In the following example, a HereDocText-value with delimiter > END_OF_CODE is used: > > <smel version='1.1'> > app(!MyApplication) > { > function(!MyFunction, params='object a, sequence b') > { > "-- Some regular double quote-delimited text" > '-- Some regular single quote-delimited text and ' $ END_OF_CODE > if sequence(a) then > return a > else > return b > end if END_OF_CODE > } /* end of function */ > } /* end of app */ >