preprocess icon indicating copy to clipboard operation
preprocess copied to clipboard

@else + @elseif directives

Open oNaiPs opened this issue 10 years ago • 19 comments

Any plans to add @else and @elseif directives?

oNaiPs avatar Sep 11 '14 00:09 oNaiPs

else + 1

jareguo avatar Feb 24 '15 12:02 jareguo

It would be nice to have @else

tonynasta avatar May 28 '15 07:05 tonynasta

+1

ssreekanth avatar May 31 '15 21:05 ssreekanth

+1

coldacid avatar Sep 11 '15 16:09 coldacid

+1

WORMSS avatar Sep 15 '15 12:09 WORMSS

+1. No else is killing me right now. Throw me an @else!

drone1 avatar Dec 05 '15 00:12 drone1

Here I am, guys! What's popping?

elsbrock avatar Dec 05 '15 11:12 elsbrock

Throw me an @else and some @elseif dawg.

On Sat, Dec 5, 2015 at 3:42 AM, Simon Elsbrock [email protected] wrote:

Here I am, guys! What's popping?

Reply to this email directly or view it on GitHub: https://github.com/jsoverson/preprocess/issues/33#issuecomment-162175179

drone1 avatar Dec 05 '15 13:12 drone1

+1

osv avatar Dec 17 '15 11:12 osv

+1

illumination517 avatar Jan 28 '16 06:01 illumination517

+1

cristi-badila avatar Feb 19 '16 15:02 cristi-badila

+1

timocov avatar Feb 23 '16 21:02 timocov

+1

J3rome avatar Apr 17 '16 08:04 J3rome

+1. Hard to believe something so common and so simple is missing.

mlamothe avatar Apr 27 '16 20:04 mlamothe

One of us should implement it. On Wed, Apr 27, 2016 at 4:40 PM Marcel Lamothe [email protected] wrote:

+1. Hard to believe something so common and so simple is missing.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/jsoverson/preprocess/issues/33#issuecomment-215220969

drone1 avatar Apr 27 '16 20:04 drone1

+1

dogancelik avatar Jul 15 '16 16:07 dogancelik

+1

lzl124631x avatar Sep 22 '16 07:09 lzl124631x

I took a look at the code, and unfortunately it's not as easy as it should be: The reason is the pattern-matching relies on XRegExp.matchRecursive, which only works with tag pairs.

Anyway, I focused solely on the else-directive and came up with a solution. It passes basic tests as well as the existing ones, and nesting seems to work just fine. I'll commit and PR soon.

hu9o avatar Jan 17 '17 23:01 hu9o

Nice one, @hu9o!

drone1 avatar Jul 28 '17 21:07 drone1