[BUG?] Conditionals, bug or working as intended??

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
bambi73 Offline
Senior Member
Posts: 195
Joined: Jan 2010
Reputation: 0
Location: Czech Republic
Post: #1
Hello there,

I have question to developers/power scraper writers. When i have following code:

Code:
<RegExp conditional="aaa" input="$$5" output="\1" dest="4">
    <RegExp input="$$1" output="\1" dest="5">
      <expression>EXP_01</expression>
    </RegExp>
    <expression/>
  </RegExp>
  <RegExp conditional="!aaa" input="$$5" output="\1" dest="4">
    <RegExp input="$$1" output="\1" dest="5">
      <expression>EXP_02</expression>
    </RegExp>
    <expression/>
  </RegExp>

i always thought that expressions nested under conditional will never be processed, but they are (in example above - not tested, only for idea - if you have $$1=EXP_01 and aaa=false, you will still get EXP_01 in $$4 instead of empty variable). Is this really how it should work or is it bug? Oo

If it is working as intended i'm wondering what is point of nested regexp elements. I'm using them (better say i thought) for hidding expensive disabled (by condition) expressions from program flow and now i need to go through whole scraper code to reevaluate potencial problems (already found nasty one when i cleared variable from second nested expression which should not be processed :sniffleSmile.

EDIT: forgot to say that i'm using XBMC version compiled from last stable svn revision, without any changes related to scraper parser.
(This post was last modified: 2010-04-18 20:03 by bambi73.)
find quote
spiff Offline
Retired Developer
Posts: 12,386
Joined: Nov 2003
Post: #2
probably a woopsie, the intention is that the conditional should nuke anything nested, but i might have poo'd a bit.
find quote
bambi73 Offline
Senior Member
Posts: 195
Joined: Jan 2010
Reputation: 0
Location: Czech Republic
Post: #3
Good to know, i'll make trac ticket for it when i return home.
I already made sure that conditional nested expressions don't modify subsequently used variables in my scraper and it works fine now, but anyway this problem error correction will mean quite decent flow optimalization Smile
find quote