Uploaded image for project: 'Shale'
  1. Shale
  2. SHALE-201

Support 2 pass symbol replacement

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Nightly
    • 1.0.3
    • Clay
    • None
    • Linux, Windows

    Description

      The following illustrates a use case for 2 pass symbol replacement.

      Client.html

      <span id="id1" jsfid="clay" clayJsfid="Template.html" name="#

      {person.name}" email="#{person.address.email"} />


      Template.html

      <body>
      Name: <span id="id2" jsfid="tree" value="@name"/>

      Email: <span id="id3" jsfid="tree" value="@email"/>
      </body>


      Custom component

      <component jsfid="tree" extends="panelGroup">
      <element renderId="1" jsfid="outputText">
      <attributes>
      <set name="value" value="@value"/>
      </attributes>
      </element>
      <validator jsfid="lengthValidator">
      ...
      </validator>
      </component>


      Currently the nested attribute [value] inside of the 1st child of tree does not realize symbol replacement because the symbol
      @value actually points to another symbol, either @name or @email depending on the context.

      With 2-pass symbol replacement this attribute would ultimately get the value #{person.name}

      or #

      {person.address.email}


      Span (id1) - > clay
      Symbol Table = { @name=#{person.name} , @email==#{person.address.email}

      }

      Span (id2) -> tree
      Symbol Table = { @name=#

      {person.name} , @email==#{person.address.email} , @value=@name}

      tree Child 1
      Symbol Table = { @name=#{person.name}

      , @email==#

      {person.address.email}

      , @value=@name}

      Such that EvalSymbol(@value) -> EvalSymbol(@name) -> #

      {person.name}

      , instead of @name

      Attachments

        Activity

          People

            gvanmatre@comcast.net Gary VanMatre
            rwynn@us.ibm.com Ryan Wynn
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: