Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-03-31 18:31:51

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

New parser testers needed

A new parser has landed in txp master branch. It means speed, short tags and much more to come. Please download and test it, to see if anything is broken (notably plugins), since the processing logic has changed quite a bit. No news would be good news. :)

Offline

#2 2016-03-31 21:00:12

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: New parser testers needed

Not sure if it was ready to land yet. Those who use XML in their pages, should test this especially.

Offline

#3 2016-03-31 22:13:20

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: New parser testers needed

Do you mean the new short tags regex? That’s what I hope to see. We can quickly revert it to the txp-only version if necessary, it runs for months on my site without any problem.

Offline

#4 2016-04-02 17:51:01

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: New parser testers needed

Yes, that’s what I meant.

Offline

#5 2016-04-03 10:03:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,599
Website

Re: New parser testers needed

Can you provide us with some pointers on the short tags?

test it, to see if anything is broken (notably plugins)

One casualty seems to be smd_wrap. I can successfully replace one instance of parse(EvalElse(…)) with parse_else(…) but there is a second instance of EvalElse on its own in the plugin code. How would one go about replacing that with the new function?


TXP Builders – finely-crafted code, design and txp

Offline

#6 2016-04-03 10:03:31

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,081
Website

Re: New parser testers needed

Finally got around loading a site with Txp4.6dev-latest patches. The following hits all pages: Front, article listings, individual articles, …

<txp:if_description> ->  Textpattern Notice: Function EvalElse is deprecated: use parse_else (and remove the separate parse() call) instead

textpattern/lib/txplib_misc.php:4229 trigger_error()
textpattern/publish/taghandlers.php:3916 EvalElse()
if_description()
textpattern/vendors/Textpattern/Tag/Registry.php:83 call_user_func()
textpattern/lib/txplib_publish.php:542 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:491 processTags()
textpattern/publish/taghandlers.php:2813 parse_else()
if_author()
textpattern/vendors/Textpattern/Tag/Registry.php:83 call_user_func()
textpattern/lib/txplib_publish.php:542 Textpattern\Tag\Registry->process()

I use this in a misc. form that goes in the head of the page

<txp:if_search><!-- nothing --><txp:else />
<txp:if_author><meta name="description" content="foo <txp:author />"><txp:else />
<txp:if_description>
<txp:meta_description /><txp:else />
<!-- missing description -->
<meta name="description" content="bar">
</txp:if_description></txp:if_author></txp:if_search>

Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#7 2016-04-03 20:56:01

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: New parser testers needed

Thanks for testing and report. There was one deprecated EvalElse() call left in core, now patched. We should probably remove this annoying notice targeting plugin authors, it’s clearly disturbing.

Re short tags, <smd::wrap /> is a short-cut for <txp:smd_wrap />, but I wouldn’t use them yet, before they get official introduction.

Offline

#8 2016-04-03 22:46:11

phiw13
Plugin Author
From: Japan
Registered: 2004-02-27
Posts: 3,081
Website

Re: New parser testers needed

etc wrote #298478:

Thanks for testing and report. There was one deprecated EvalElse() call left in core, now patched.

Thanks for the quick fix. I’ll test further later today, and see if I can find something else to keep you busy :-).


Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern

Offline

#9 2016-04-04 09:20:15

NicolasGraph
Plugin Author
From: France
Registered: 2008-07-24
Posts: 860
Website

Re: New parser testers needed

Hi,
No bug for me now; just want to say that this morning update really boosted my local 4.6… Thank you for your work! (Previous update was about a week ago)

Last edited by NicolasGraph (2016-05-26 12:56:02)


Nicolas
Follow me on Twitter and GitHub!
Multiple edits are usually to correct my frenglish…

Offline

#10 2016-04-04 15:49:27

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: New parser testers needed

jakob wrote #298471:

One casualty seems to be smd_wrap. I can successfully replace one instance of parse(EvalElse(…)) with parse_else(…) but there is a second instance of EvalElse on its own in the plugin code. How would one go about replacing that with the new function?

I have updated a branch with some parser tweaks, with this “deprecated” notice removed. Now EvalElse($thing, $condition) should make no noise, but rather replace parse(EvalElse($thing, $condition)) with parse($thing, $condition) in this branch (of which parse_else($thing, $condition) is just an alias).

Offline

#11 2016-04-04 19:45:13

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: New parser testers needed

Are there more plugins that use EvalElse on its own, without calling parse… and can they be made to work with the new parser?

The deprecated notice should not be removed. The use of EvalElse is deprecated, so it should make noise, so plugin developers can fix their code and EvalElse can be dropped in a future version.

Interesting parser tweaks! Do they improve performance?

Offline

#12 2016-04-04 20:08:34

etc
Developer
Registered: 2010-11-11
Posts: 5,057
Website GitHub

Re: New parser testers needed

ruud wrote #298488:

Are there more plugins that use EvalElse on its own, without calling parse… and can they be made to work with the new parser?

Yes, at least smd_query and etc_query separate true/false parts to do some substitutions before calling the parser. Replacing EvalElse() with parse_else would break some of their functionality. I don’t see how to easily patch it atm.

The deprecated notice should not be removed. The use of EvalElse is deprecated, so it should make noise, so plugin developers can fix their code and EvalElse can be dropped in a future version.

I’m not sure EvalElse is deprecated per se, see the first point. :) parse(EvalElse()) is, of course, but even there replacing EvalElse with parse_else (or parse now) would result in parsing twice.

Interesting parser tweaks! Do they improve performance?

Thanks. No, no noticeable runtime difference (though I haven’t tested on a page with million tags), but I prefer to merge similar functions — less code to maintain. It would also be nice to totally separate parsing from processing one day. And my feeling is we should protect txp_parsed/else inside some class, if it does not penalize performance too much.

Offline

Board footer

Powered by FluxBB