diff --git a/vscode-ext/syntaxes/heyvl.tmLanguage.json b/vscode-ext/heyvl/heyvl.tmLanguage.json similarity index 100% rename from vscode-ext/syntaxes/heyvl.tmLanguage.json rename to vscode-ext/heyvl/heyvl.tmLanguage.json diff --git a/vscode-ext/language-configuration.json b/vscode-ext/heyvl/language-configuration.json similarity index 100% rename from vscode-ext/language-configuration.json rename to vscode-ext/heyvl/language-configuration.json diff --git a/vscode-ext/heyvl/snippets.json b/vscode-ext/heyvl/snippets.json new file mode 100644 index 0000000..380891a --- /dev/null +++ b/vscode-ext/heyvl/snippets.json @@ -0,0 +1,201 @@ +{ + "Proc Declaration": { + "prefix": [ + "proc" + ], + "body": [ + "proc ${1:name}(${2:}) -> (${3:}) {", + "\t$0", + "}" + ], + "description": "A proc declaration." + }, + "Coproc Declaration": { + "prefix": [ + "coproc" + ], + "body": [ + "coproc ${1:name}(${2:}) -> (${3:}) {", + "\t$0", + "}" + ], + "description": "A coproc declaration." + }, + "Domain Declaration": { + "prefix": [ + "domain" + ], + "body": [ + "domain ${1:Name} {", + "\t$0", + "}" + ], + "description": "A domain declaration." + }, + "Func Declaration": { + "prefix": [ + "func" + ], + "body": [ + "func ${1:name}($2): $0" + ], + "description": "An uninterpreted function declaration (func)." + }, + "Func Definition": { + "prefix": [ + "funcdef" + ], + "body": [ + "func ${1:name}($2): ${1:UInt} = $0" + ], + "description": "An uninterpreted function definition with a body." + }, + "Axiom Declaration": { + "prefix": [ + "axiom" + ], + "body": [ + "axiom ${1:axiom$RANDOM_HEX} $0" + ], + "description": "An axiom declaration." + }, + "Axiom-Forall Declaration": { + "prefix": [ + "axforall" + ], + "body": [ + "axiom ${1:axiom$RANDOM_HEX} forall ${2:}. $0" + ], + "description": "An axiom declaration with a forall quantifier inside." + }, + "Variable Declaration Statement": { + "prefix": [ + "var" + ], + "body": [ + "var ${1:name}: $2 " + ], + "description": "A variable declaration statement." + }, + "Variable Initialization Statement": { + "prefix": [ + "vardecl" + ], + "body": [ + "var ${1:name}: $2 = $0" + ], + "description": "A variable declaration statement with an initializer." + }, + "Coin Flip Statement": { + "prefix": [ + "flip" + ], + "body": [ + "var ${1:prob_choice}: Bool = flip(${2:0.5})" + ], + "description": "A coin flip." + }, + "If Statement": { + "prefix": [ + "if" + ], + "body": [ + "if $1 {", + "\t$0", + "} else {", + "\t", + "}" + ], + "description": "An if-then-else statement." + }, + "Boolean Assume Statement": { + "prefix": [ + "bassume" + ], + "body": [ + "assume ?($0)" + ], + "description": "A Boolean assumption statement." + }, + "Boolean Assert Statement": { + "prefix": [ + "bassert" + ], + "body": [ + "assert ?($0)" + ], + "description": "A Boolean assertion statement." + }, + "Boolean Coassume Statement": { + "prefix": [ + "bcoassume" + ], + "body": [ + "coassume !?($0)" + ], + "description": "A Boolean coassumption statement." + }, + "Boolean Coassert Statement": { + "prefix": [ + "bcoassert" + ], + "body": [ + "coassert !?($0)" + ], + "description": "A Boolean coassertion statement." + }, + "Constant Assertion Statement": { + "prefix": [ + "assertconst" + ], + "body": [ + "assert $1; assume ?(false)" + ], + "description": "A constant assertion statement." + }, + "Constant Coassertion Statement": { + "prefix": [ + "coassertconst" + ], + "body": [ + "coassert $1; coassume !?(false)" + ], + "description": "A constant coassertion statement." + }, + "Reward Statement": { + "prefix": [ + "reward" + ], + "body": [ + "reward ${1:1}" + ], + "description": "A reward statement." + }, + "Forall Expression": { + "prefix": [ + "forall" + ], + "body": [ + "forall $1. $0" + ], + "description": "A forall expression." + }, + "Exists Expression": { + "prefix": [ + "exists" + ], + "body": [ + "exists $1. $0" + ], + "description": "An exists expression." + }, + "Ite Expression": { + "prefix": [ + "ite" + ], + "body": [ + "ite($1, $2, $0)" + ], + "description": "An ite expression (if-then-else)." + } +} \ No newline at end of file diff --git a/vscode-ext/package.json b/vscode-ext/package.json index 8f31983..fbd1897 100644 --- a/vscode-ext/package.json +++ b/vscode-ext/package.json @@ -39,14 +39,20 @@ "extensions": [ ".heyvl" ], - "configuration": "./language-configuration.json" + "configuration": "./heyvl/language-configuration.json" } ], "grammars": [ { "language": "heyvl", "scopeName": "source.heyvl", - "path": "./syntaxes/heyvl.tmLanguage.json" + "path": "./heyvl/heyvl.tmLanguage.json" + } + ], + "snippets": [ + { + "language": "heyvl", + "path": "./heyvl/snippets.json" } ], "configuration": {