Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added easycrypt-mode snippets #503

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
/report/.nrepl-port
/.clj-kondo/
/.lsp/
*~
\#*\#
.\#*
7 changes: 7 additions & 0 deletions snippets/easycrypt-mode/lookup/locate
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: L
# group: lookup
# name: locate
# expand-env: ((yas-indent-line 'fixed))
# --
locate $1.
7 changes: 7 additions & 0 deletions snippets/easycrypt-mode/lookup/print
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: P
# group: lookup
# name: print
# expand-env: ((yas-indent-line 'fixed))
# --
print $1.
7 changes: 7 additions & 0 deletions snippets/easycrypt-mode/lookup/search
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: S
# group: lookup
# name: search
# expand-env: ((yas-indent-line 'fixed))
# --
search $1.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/abbrev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: abbrev
# key: abbrev
# expand-env: ((yas-indent-line 'fixed))
# --
abbrev $1 = $2.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/and1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: and1
# key: and1
# expand-env: ((yas-indent-line 'fixed))
# --
$1 /\ $2
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/and2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: and2
# key: and2
# expand-env: ((yas-indent-line 'fixed))
# --
$1 && $2
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/comment
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: comment
# key: comment
# expand-env: ((yas-indent-line 'fixed))
# --
(* $1 *)
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/forall
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: forall
# key: forall
# expand-env: ((yas-indent-line 'fixed))
# --
forall ($1: $2), $3
6 changes: 6 additions & 0 deletions snippets/easycrypt-mode/misc/from
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# key: from
# group: misc
# name: from
# --
from $1 require import $2.
7 changes: 7 additions & 0 deletions snippets/easycrypt-mode/misc/from-jasmin
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: from-jasmin
# group: misc
# name: from-jasmin
# expand-env: ((yas-indent-line 'fixed))
# --
from Jasmin require import $1.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/fun
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: fun
# key: fun
# expand-env: ((yas-indent-line 'fixed))
# --
fun ($1) => $2
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/ge0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: ge0
# key: ge0
# expand-env: ((yas-indent-line 'fixed))
# --
0 <= $1
6 changes: 6 additions & 0 deletions snippets/easycrypt-mode/misc/geq0
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# name: ge0
# key: ge0
# --
0 <= $1
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/hint-simplify
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: hint-simplify
# key: hint
# expand-env: ((yas-indent-line 'fixed))
# --
hint simplify $1.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/if
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: if
# key: if
# expand-env: ((yas-indent-line 'fixed))
# --
if $1 then $2 else $3
7 changes: 7 additions & 0 deletions snippets/easycrypt-mode/misc/import
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: import
# group: misc
# name: import
# expand-env: ((yas-indent-line 'fixed))
# --
import $1.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/let-in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: let-in
# key: let-in
# expand-env: ((yas-indent-line 'fixed))
# --
let $1 in $2
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/list
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: list
# key: list
# expand-env: ((yas-indent-line 'fixed))
# --
[$1 ; $2]
6 changes: 6 additions & 0 deletions snippets/easycrypt-mode/misc/new-comment
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# name: new-comment
# key: new-comment
# --
(* $1 *)
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/or1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: or1
# key: or1
# expand-env: ((yas-indent-line 'fixed))
# --
$1 \/ $2
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/or2
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: or2
# key: or2
# expand-env: ((yas-indent-line 'fixed))
# --
$1 || $2
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/param
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: param
# key: param
# expand-env: ((yas-indent-line 'fixed))
# --
($1 : $2)
7 changes: 7 additions & 0 deletions snippets/easycrypt-mode/misc/pred
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: pred
# group: misc
# name: pred
# expand-env: ((yas-indent-line 'fixed))
# --
pred $1 = $2.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/probability
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: probability
# key: probability
# expand-env: ((yas-indent-line 'fixed))
# --
Pr[$1]
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/probability-mem
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: probability-memory
# key: probability-memory
# expand-env: ((yas-indent-line 'fixed))
# --
Pr[$1 @ &$2 : $3]
6 changes: 6 additions & 0 deletions snippets/easycrypt-mode/misc/range
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# name: range
# key: range
# --
$1 <= $2 <= $3
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/range-exclusive
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: range-exclusive
# key: range-exclusive
# expand-env: ((yas-indent-line 'fixed))
# --
$1 < $2 < $3
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/range-exclusive-inclusive
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: range-exclusive-inclusive
# key: range-exclusive-inclusive
# expand-env: ((yas-indent-line 'fixed))
# --
$1 < $2 <= $3
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/range-inclusive
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: range-inclusive
# key: range-inclusive
# expand-env: ((yas-indent-line 'fixed))
# --
$1 <= $2 <= $3
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/misc/range-inclusive-exclusive
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: tactics
# name: range-inclusive-exclusive
# key: range-inclusive-exclusive
# expand-env: ((yas-indent-line 'fixed))
# --
$1 <= $2 < $3
7 changes: 7 additions & 0 deletions snippets/easycrypt-mode/misc/require-import
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: require-import
# group: misc
# name: require-import
# expand-env: ((yas-indent-line 'fixed))
# --
require import $1.
10 changes: 10 additions & 0 deletions snippets/easycrypt-mode/modules/module
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: modules
# name: module
# key: module
# expand-env: ((yas-indent-line 'fixed))
# --
module $1 = {

}.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/modules/module-instance
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: modules
# name: module-instance
# key: module-instance
# expand-env: ((yas-indent-line 'fixed))
# --
module $1 = $2($3).
10 changes: 10 additions & 0 deletions snippets/easycrypt-mode/modules/module-type
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: modules
# name: module-type
# key: module-type
# expand-env: ((yas-indent-line 'fixed))
# --
module type $1 = {

}.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/modules/module-with-params
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# name: module-with-params
# key: module-with-params
# --
module $1 ($2: $3) : $4 {

}.
10 changes: 10 additions & 0 deletions snippets/easycrypt-mode/modules/module-with-params-return
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: modules
# name: module-with-params-return
# key: module-with-params-return
# expand-env: ((yas-indent-line 'fixed))
# --
module $1 ($2: $3) : $4 {

}.
10 changes: 10 additions & 0 deletions snippets/easycrypt-mode/modules/module-with-return
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: modules
# name: module-with-return
# key: module-with-return
# expand-env: ((yas-indent-line 'fixed))
# --
module $1 : $2 = {

}.
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/procedures/assign
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: procedures
# name: assign
# key: assign
# expand-env: ((yas-indent-line 'fixed))
# --
$1 <- $2;
8 changes: 8 additions & 0 deletions snippets/easycrypt-mode/procedures/decrement-counter
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: procedures
# name: decrement-counter
# key: decrement-counter
# expand-env: ((yas-indent-line 'fixed))
# --
$1 <- $1 - 1;
12 changes: 12 additions & 0 deletions snippets/easycrypt-mode/procedures/if-else-proc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# -*- mode: snippet -*-
# contributor: João Diogo Duarte
# group: procedures
# name: if-else-proc
# key: if-else-proc
# expand-env: ((yas-indent-line 'fixed))
# --
if ($1){

} else {

}
Loading