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

Update grammar.py to fix parsing errors #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Moneysac90
Copy link

I encountered multiple parsing errors because the unit_address is considered being a hex value. This will fail on e.g. the following type of nodes.

node with a hex value but 0x prefixed

uart@0x8000000 {
	compatible = "xlnx";
	reg = <0x1000>;
	interrupts = <0x3b 0x00>;
	clock = <0x2faf080>;
};

node using a variable name some_var instead of an address

uart@some_var {
	compatible = "xlnx";
	reg = <0x1000>;
	interrupts = <0x3b 0x00>;
	clock = <0x2faf080>;
};

node using invalid hex values (in the practice we saw multiple files using float values)

uart@0,0 {
	compatible = "xlnx";
	reg = <0x1000>;
	interrupts = <0x3b 0x00>;
	clock = <0x2faf080>;
};

I encountered multiple parsing errors because the `unit_address` is considered being a hex value. This will fail on e.g. the following type of nodes.

node with a hex value but `0x` prefixed
```
uart@0x8000000 {
	compatible = "xlnx";
	reg = <0x1000>;
	interrupts = <0x3b 0x00>;
	clock = <0x2faf080>;
};
```

node using a variable name `some_var` instead of an address
```
uart@some_var {
	compatible = "xlnx";
	reg = <0x1000>;
	interrupts = <0x3b 0x00>;
	clock = <0x2faf080>;
};
```

node using invalid hex values (in the practice we saw multiple files using float values)
```
uart@0,0 {
	compatible = "xlnx";
	reg = <0x1000>;
	interrupts = <0x3b 0x00>;
	clock = <0x2faf080>;
};
```
@Moneysac90 Moneysac90 mentioned this pull request Jun 19, 2024
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

Successfully merging this pull request may close these issues.

1 participant