Skip to content

Commit 7e0da2b

Browse files
committed
Add more migrations
1 parent f7bc938 commit 7e0da2b

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

config/migrations.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,37 @@
2121
{"regex": "<argument><expr>([A-Za-z_][A-Za-z0-9_]*)</expr></argument>",
2222
"replace": "<argument><expr><name>\\1</name></expr></argument>"}
2323
]
24+
},
25+
{
26+
"name": "argument-operator-embed",
27+
"description": "Bare operator-only argument (e.g. `^`, `^=`, `|`, `&&`) gains an <operator> wrapper inside the new <expr>.",
28+
"replacements": [
29+
{"regex": "<argument><expr>(\\|\\||&&|[|&^+\\-*/%]=?|~|!)</expr></argument>",
30+
"replace": "<argument><expr><operator>\\1</operator></expr></argument>"}
31+
]
32+
},
33+
{
34+
"name": "argument-struct-name-embed",
35+
"description": "Bare `struct NAME` argument: the type name gains a <name> wrapper inside the new <expr>, while the `struct` keyword stays bare.",
36+
"replacements": [
37+
{"regex": "<argument><expr>struct ([A-Za-z_][A-Za-z0-9_]*)</expr></argument>",
38+
"replace": "<argument><expr>struct <name>\\1</name></expr></argument>"}
39+
]
40+
},
41+
{
42+
"name": "argument-bare-call-embed",
43+
"description": "Bare zero-arg call `NAME()` argument is marked up as <call><name>NAME</name><argument_list>()</argument_list></call> inside the new <expr>.",
44+
"replacements": [
45+
{"regex": "<argument><expr>([A-Za-z_][A-Za-z0-9_]*)\\(\\)</expr></argument>",
46+
"replace": "<argument><expr><call><name>\\1</name><argument_list>()</argument_list></call></expr></argument>"}
47+
]
48+
},
49+
{
50+
"name": "empty-self-closing-argument",
51+
"description": "Older srcml emitted empty macro arguments as <argument/>; newer versions omit the element entirely.",
52+
"replacements": [
53+
["<argument/>", ""]
54+
]
2455
}
2556
]
2657
}

0 commit comments

Comments
 (0)