Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 25 additions & 21 deletions syntaxes/systemtap.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
},
"array": {},
"function_dec": {
"begin": "(function)\\s+([\\w.]+)",
"begin": "(function)\\s([\\w.]+)",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More than one space is legal, for example: function foo(bar)

"end": "(?=\\%?{)",
"beginCaptures": {
"1": {
Expand All @@ -164,12 +164,7 @@
},
"patterns": [
{
"begin": "(?:(?<=:)\\s*([^\\s\\:]+))?(\\()",
"beginCaptures": {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is processe the type of rreturn value (like function foo:long(bar))

"1": {
"name": "storage.type.built-in.systemtap"
}
},
"begin": "(\\()",
"end": "(?=[)])",
"patterns": [
{
Expand All @@ -185,36 +180,45 @@
]
},
"probe_dec": {
"begin": "(probe)\\s([\\w.]+)",
"begin": "(probe)\\s+(?![#\\{]+)",
"end": "(?=\\{)",
"beginCaptures": {
"1": {
"name": "keyword.control.systemtap"
},
"2": {
"name": "entity.name.function.definition.systemtap"
}
},
"patterns": [
{
"include": "#comment"
},
{
"match": "(process|function|module|statement|begin|end|syscall|return|call|never)(?![@a-zA-Z0-9_$])",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some probes not in this list, see https://sourceware.org/systemtap/tapsets/

"name": "keyword.control.systemtap"
},
{
"match": "([\\w]+)",
"name": "entity.name.function.definition.systemtap"
},
{
"match": "(\\.)",
"name": "punctuation.separator.dot.systemtap"
},
{
"begin": "(\\()",
"end": "(?=[)])",
"patterns": [
{
"include": "#string_context"
},
{
"include": "#number"
"include": "#expr"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this should not accept variables

},
{
"match": "(?<=:)([^\\s,):]+)",
"name": "storage.type.built-in.systemtap"
},
{
"match": "[^\\s,):]+",
"match": "[^\\s,)]+",
"name": "variable.parameter"
}
]
},
{
"match": "([*!?])",
"name": "keyword.operator.systemtap"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use keyword.operator.quantifier.systemtap instead

}
]
},
Expand Down Expand Up @@ -396,7 +400,7 @@
]
},
"macro": {
"begin": "(@(?:defined|define))",
"begin": "(@define(?!d))",
"end": "(?<!\\\\)(?=(?:\\%\\(|\\n))",
"beginCaptures": {
"1": {
Expand Down