Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[svd_parser]: Tags that contain a XML comment are ignored. #228

Open
pellico opened this issue Sep 8, 2023 · 0 comments
Open

[svd_parser]: Tags that contain a XML comment are ignored. #228

pellico opened this issue Sep 8, 2023 · 0 comments

Comments

@pellico
Copy link

pellico commented Sep 8, 2023

svd_parser 0.14.1

If a tag contains a XML comment the tag content is ignored.
see tag licenseText
Below XML has been validated against latest svd.xsd.

How to reproduce:

use svd_parser;


fn main() {

    let xml=r#"<?xml version="1.0" encoding="utf-8"?>
<device schemaVersion="1.1" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="svd.xsd">

	<name>ARM_Example</name>
	<series>ARMCM3</series>
	<version>1.2</version>
	<description>SVD Test for Rust PAC generator</description>
	<licenseText><!-- this license text will appear in header file. \n force line breaks --> Test license\n </licenseText>
	<cpu>
		<!-- details about the cpu embedded in the device -->
		<name>CM3</name>
		<revision>r1p0</revision>
		<endian>little</endian>
		<mpuPresent>true</mpuPresent>
		<fpuPresent>false</fpuPresent>
		<nvicPrioBits>3</nvicPrioBits>
		<vendorSystickConfig>false</vendorSystickConfig>
	</cpu>
	<addressUnitBits>8</addressUnitBits>
	<width>32</width>
	<size>32</size>
	<access>read-write</access>
	<resetValue>0x00000000</resetValue>
	<resetMask>0xFFFFFFFF</resetMask>
	<peripherals>
		<peripheral>
			<name>UART</name>
			<baseAddress>0x50000000</baseAddress>
			<registers>
				<register>
					<name>Reg1</name>
					<addressOffset>0x0</addressOffset>
					<resetMask>0xFFFFFFFF</resetMask>
				</register>
			</registers>
		</peripheral>
	</peripherals>
</device>
    "#;
    let device = svd_parser::parse(xml).unwrap();
    println!("{:?}",device.license_text);
    println!("{:?}",device.description);

}
@pellico pellico changed the title [svd_parser]: Tag that contains XML are ignored. [svd_parser]: Tags that contain a XML comment are ignored. Sep 8, 2023
@Emilgardis Emilgardis mentioned this issue Sep 17, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant