Skip to content

Commit 9f529c7

Browse files
committed
refactored frame with select-frame #43
1 parent d27fa12 commit 9f529c7

File tree

2 files changed

+49
-31
lines changed

2 files changed

+49
-31
lines changed

syntaxes/gdb.tmLanguage.json

+40-31
Original file line numberDiff line numberDiff line change
@@ -1350,40 +1350,16 @@
13501350
"name": "meta.command.frame.gdb",
13511351
"begin": "(?:^|\\G)[ \t]*\\b(f(?:r(?:a(?:me?)?)?)?)\\b[ \t]*",
13521352
"beginCaptures": { "1": { "name": "keyword.control.command.gdb" } },
1353-
"patterns": [
1354-
{
1355-
"match": "\\b(l(?:e(?:v(?:el?)?)?)?[ \t]+)?\\b([0-9]+)[ \t]*$",
1356-
"captures": {
1357-
"1": { "name" : "support.function.option.gdb"},
1358-
"2": { "patterns": [ { "include": "#numeric"} ] }
1359-
}
1360-
},
1361-
{
1362-
"match": "\\b(ad(?:d(?:r(?:e(?:ss?)?)?)?)?[ \t]+)\\b(0x\\h+)[ \t]*$",
1363-
"captures": {
1364-
"1": { "name" : "support.function.option.gdb"},
1365-
"2": { "patterns": [ { "include": "#numeric"} ] }
1366-
}
1367-
},
1368-
{
1369-
"match": "\\b(f(?:u(?:n(?:c(?:t(?:i(?:on?)?)?)?)?)?)?[ \t]+)\\b(\\w+)[ \t]*$",
1370-
"captures": {
1371-
"1": { "name" : "support.function.option.gdb"},
1372-
"2": { "patterns": [ { "include": "#location"} ] }
1373-
}
1374-
},
1353+
"patterns": [ { "include": "#frame-spec" } ],
1354+
"end": "$"
1355+
},
13751356
{
1376-
"match": "\\b(v(?:i(?:ew?)?)?)\\b[ \t]+\\b(0x\\h+)\\b(?:[ \t]+\\b(0x\\h+))?[ \t]*$",
1377-
"captures": {
1378-
"1": { "name" : "support.function.option.gdb"},
1379-
"2": { "patterns": [ { "include": "#numeric"} ] },
1380-
"3": { "patterns": [ { "include": "#numeric"} ] }
1381-
}
1382-
}
1383-
],
1357+
"name": "meta.command.select-frame.gdb",
1358+
"begin": "(?:^|\\G)[ \t]*\\b(sele(?:c(?:t(?:-(?:f(?:r(?:a(?:me?)?)?)?)?)?)?)?)[ \t]*",
1359+
"beginCaptures": { "1": { "name": "keyword.control.command.gdb" } },
1360+
"patterns": [ { "include": "#frame-spec" } ],
13841361
"end": "$"
13851362
}
1386-
13871363
]
13881364
},
13891365
"block": {
@@ -1732,6 +1708,39 @@
17321708
"captures": { "1": { "name": "markup.bold.color.white.gdb" } }
17331709
}
17341710
]
1711+
},
1712+
"frame-spec": {
1713+
"patterns": [
1714+
{
1715+
"match": "\\b(l(?:e(?:v(?:el?)?)?)?[ \t]+)?\\b([0-9]+)[ \t]*$",
1716+
"captures": {
1717+
"1": { "name" : "support.function.option.gdb"},
1718+
"2": { "patterns": [ { "include": "#numeric"} ] }
1719+
}
1720+
},
1721+
{
1722+
"match": "\\b(ad(?:d(?:r(?:e(?:ss?)?)?)?)?[ \t]+)\\b(0x\\h+)[ \t]*$",
1723+
"captures": {
1724+
"1": { "name" : "support.function.option.gdb"},
1725+
"2": { "patterns": [ { "include": "#numeric"} ] }
1726+
}
1727+
},
1728+
{
1729+
"match": "\\b(f(?:u(?:n(?:c(?:t(?:i(?:on?)?)?)?)?)?)?[ \t]+)\\b(\\w+)[ \t]*$",
1730+
"captures": {
1731+
"1": { "name" : "support.function.option.gdb"},
1732+
"2": { "patterns": [ { "include": "#location"} ] }
1733+
}
1734+
},
1735+
{
1736+
"match": "\\b(v(?:i(?:ew?)?)?)\\b[ \t]+\\b(0x\\h+)\\b(?:[ \t]+\\b(0x\\h+))?[ \t]*$",
1737+
"captures": {
1738+
"1": { "name" : "support.function.option.gdb"},
1739+
"2": { "patterns": [ { "include": "#numeric"} ] },
1740+
"3": { "patterns": [ { "include": "#numeric"} ] }
1741+
}
1742+
}
1743+
]
17351744
}
17361745
}
17371746
}

tests/tests/command/select-frame.gdb

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
sele 1
2+
selec 1
3+
select 1
4+
select- 1
5+
select-f 1
6+
select-fr 1
7+
select-fra 1
8+
select-fram 1
9+
select-frame 1

0 commit comments

Comments
 (0)