Commit 834b63e
* fix(parser): Correctly handle asm attributes on register variables
Adds support for `asm` attributes on `register` variables by allowing `asm` and `attributes` to be added to `TypeDeclExt` and `ArrayDeclExt` nodes.
This was preventing the parser from attaching `asm` labels to declarations with storage-class specifiers like `register`.
A new test case, `test_register_asm_label`, is added to verify that declarations like `register int my_var asm("my_reg");` are now parsed correctly.
* test: Add comprehensive round-trip tests for register asm labels
This commit enhances the test_register_asm_label test to include
round-trip testing, which was the main issue reported in #33.
The original issue stated: 'when I convert it back to C-Code then no
C-Code is created for this line.'
This fix adds:
- Round-trip test for basic asm syntax
- Round-trip test for __asm__ variant
- Round-trip test for different type specifiers
All tests verify that parsing and code generation work correctly.
* style: Fix ruff linting issues
- Change single quotes to double quotes in __slots__ declarations
- Fix import ordering (pycparser before pycparserext)
- Standardize quote style in test assertions
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: II Assistant <assistant@example.com>
1 parent 51ce930 commit 834b63e
2 files changed
+36
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| 190 | + | |
| 191 | + | |
190 | 192 | | |
191 | 193 | | |
192 | 194 | | |
| |||
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| 206 | + | |
| 207 | + | |
204 | 208 | | |
205 | 209 | | |
206 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
128 | 160 | | |
129 | 161 | | |
130 | 162 | | |
| |||
0 commit comments