Navigation Menu

Skip to content

Commit

Permalink
copy p4.json instead of linking so that docker can build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Calin Cascaval committed Jun 27, 2017
1 parent bbba3eb commit 8d4feee
Showing 1 changed file with 118 additions and 1 deletion.
1 change: 0 additions & 1 deletion p4-16/psa/p4.json

This file was deleted.

118 changes: 118 additions & 0 deletions p4-16/psa/p4.json
@@ -0,0 +1,118 @@
{
"displayName": "P4",
"name": "p4",

"lineComment": "//",
"blockCommentStart": "/*",
"blockCommentEnd": "*/",

"keywords": [ "action", "apply", "control", "default", "else",
"extern", "exit", "false", "if",
"package", "parser", "return", "select", "state", "switch",
"table", "transition", "true", "typedef", "verify"
],

"extraKeywords": [],

"typeKeywords": [
"bool", "bit", "const", "enum", "entries", "error", "header", "header_union", "in", "inout", "int", "match_kind", "out", "tuple", "struct", "varbit", "void"
],

"extraTypeKeywords": [],

"directives": [
"include","if","endif","ifdef","define","ifndef","undef","line"
],

"annotations": [
"atomic", "defaultonly", "name", "priority", "tableonly", "hidden", "globalname"
],

"operators": [
"=", ">", "<", "!", "~", "?", ":",
"==", "<=", ">=", "!=", "&&", "||", "++",
"+", "-", "*", "/", "&", "|", "^", "%", "<<",
">>", "&&&", ".."
],

"extraOperators": [],

"symbols": "[=><!~?:&|+\\-*\\/\\^%]+",
"escapes": "\\\\(?:[abfnrtv\\\\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})",


"tokenizer": {
"root": [

["__\\w+", "identifier.predefined"],
["\\w+::(?=\\w)", "namespace" ],
["(namespace)(\\s*)((?:\\w+::)*\\w+)", ["keyword","white","namespace"] ],

["[a-z_$][\\w]*", { "cases": {
"@typeKeywords": "keyword.type",
"@extraTypeKeywords": "keyword.type.extra",
"@keywords": "keyword",
"@extraKeywords": "keyword.extra",
"@default": "identifier" } }],


["^(\\s*#)(\\w+)(.*)", { "cases": {
"$2@directives": ["namespace","namespace","string"],
"@default": ["meta","meta","string"]
}}],

["^(\\s*@)(\\w+)(.*)", { "cases": {
"$2@annotations": ["namespace","namespace","string"],
"@default": ["meta","meta","string"]
}}],

{ "include": "@whitespace" },

["[{}()\\[\\]]", "@brackets"],
["[<>](?!@symbols)", "@brackets"],
["@symbols", { "cases": {
"@operators": "operator",
"@extraOperators": "operator.extra",
"@default" : "" } } ],

["\\d*\\.\\d+([eE][\\-+]?\\d+)?[fFdD]?", "number.float"],
["0[xX][0-9a-fA-F_]*[0-9a-fA-F][Ll]?", "number.hex"],
["0[0-7_]*[0-7][Ll]?", "number.octal"],
["0[bB][0-1_]*[0-1][Ll]?", "number.binary"],
["\\d+[lL]?", "number"],


["[;,.]", "delimiter"],


["[lL]\"([^\"\\\\]|\\\\.)*$", "string.invalid" ],
["\"", "string", "@string" ],


["'[^\\\\']'", "string"],
["(')(@escapes)(')", ["string","string.escape","string"]],
["'", "string.invalid"]
],

"whitespace": [
["[ \\t\\r\\n]+", "white"],
["\\/\\*", "comment", "@comment" ],
["\\/\\/.*$", "comment"]
],

"comment": [
["[^\\/*]+", "comment" ],

["\\/\\*", "comment.invalid" ],
["\\*/", "comment", "@pop" ],
["[\\/*]", "comment" ]
],

"string": [
["[^\\\\\"]+", "string"],
["@escapes", "string.escape"],
["\\\\.", "string.escape.invalid"],
["\"", "string", "@pop" ]
]
}
}

0 comments on commit 8d4feee

Please sign in to comment.