daffodil-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Thompson (Jira)" <j...@apache.org>
Subject [jira] [Closed] (DAFFODIL-2062) NadaParser not optimized out
Date Thu, 20 May 2021 12:35:10 GMT

     [ https://issues.apache.org/jira/browse/DAFFODIL-2062?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Dave Thompson closed DAFFODIL-2062.
-----------------------------------

Closed due to no activity and  no re-occurrence. If the issue re-occurs the ticket can be
reopened or addressed in a new one.

> NadaParser not optimized out
> ----------------------------
>
>                 Key: DAFFODIL-2062
>                 URL: https://issues.apache.org/jira/browse/DAFFODIL-2062
>             Project: Daffodil
>          Issue Type: Bug
>          Components: Front End
>    Affects Versions: 2.3.0
>            Reporter: Steve Lawrence
>            Assignee: Dave Thompson
>            Priority: Major
>             Fix For: 2.4.0
>
>
> Assume the following schema:
> {code:xml}
>   <xs:element name="test">
>     <xs:complexType>
>       <xs:sequence>
>         <xs:element name="count" type="xs:int" dfdl:lengthKind="explicit" dfdl:length="1"
/>
>         <xs:element name="record" dfdl:lengthKind="explicit" dfdl:length="2" maxOccurs="unbounded"
>           dfdl:occursCountKind="expression" dfdl:occursCount="{ ../count }">
>           <xs:complexType>
>             <xs:sequence>
>             <!--
>               <xs:element name="value1" dfdl:lengthKind="explicit" dfdl:length="1"
type="xs:string" />
>               <xs:element name="value2" dfdl:lengthKind="explicit" dfdl:length="1"
type="xs:string" />
>             -->
>             </xs:sequence>
>           </xs:complexType>
>         </xs:element>
>       </xs:sequence>
>     </xs:complexType>
>   </xs:element>
> {code}
> This schema works if we uncomment the value1 and value2 elements. However, with them
commented out, this schema should still work. The {{record}} element has an explciit length,
so this should just skip over 2 bytes, count number of times. Instead, it results in the following
exception:
> {code}
> org.apache.daffodil.exceptions.Abort: NadaParsers are all supposed to optimize out!
> org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
> org.apache.daffodil.processors.parsers.NadaParser.parse(Parser.scala:150)
> org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:76)
> org.apache.daffodil.processors.parsers.Parser.parse1$(Parser.scala:70)
> 	at org.apache.daffodil.exceptions.Assert$.abort(Assert.scala:129)
> 	at org.apache.daffodil.processors.parsers.NadaParser.parse(Parser.scala:150)
> 	at org.apache.daffodil.processors.parsers.Parser.parse1(Parser.scala:76)
> {code}
> So the empty sequence results in a NadaParser, which should have been optimized out.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message