-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding snippets for the Odin language (#483)
* Create case * Add files via upload
- Loading branch information
Showing
18 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- mode: snippet -*- | ||
# name: case | ||
# key: case | ||
# -- | ||
case ${1: $(indent-according-to-mode)}: | ||
$0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: defer if | ||
# key: dfri | ||
# -- | ||
defer if $1 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: distinct | ||
# key: distinct | ||
# -- | ||
${1:name} :: distinct { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: enum | ||
# key: enum | ||
# -- | ||
${1:name} :: enum { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# -*- mode: snippet -*- | ||
# name: for do | ||
# key: fd | ||
# -- | ||
for $1; $2; $3 do ${0: $(indent-according-to-mode)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: for | ||
# key: for | ||
# -- | ||
for $1; $2; $3 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: for (with directive) | ||
# key: ford | ||
# -- | ||
${1:Directive(TAB to skip)$(if (and (not yas-modified-p) yas-moving-away-p) (yas-skip-and-clear-field) nil)} for ${2: } { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: for in | ||
# key: fori | ||
# -- | ||
for $1 in $2 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: if | ||
# key: if | ||
# -- | ||
if $1 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: if else | ||
# key: ife | ||
# -- | ||
if ${1: $(if (and (not yas-modified-p) yas-moving-away-p) (yas-skip-and-clear-field) nil)}; ${2: } { | ||
$3 | ||
} else $0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: if (with initialization) | ||
# key: ifz | ||
# -- | ||
if $1; $2 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: proc | ||
# key: pr | ||
# -- | ||
${1:name} :: proc($2) -> $3 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: struct | ||
# key: struct | ||
# -- | ||
${1:name} :: struct { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: switch | ||
# key: sw | ||
# -- | ||
switch $1;$2 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: partial switch | ||
# key: swp | ||
# -- | ||
#partial switch $1;$2 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: union | ||
# key: union | ||
# -- | ||
${1:name} :: union { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# -*- mode: snippet -*- | ||
# name: when | ||
# key: when | ||
# -- | ||
when $1 { | ||
${0: $(indent-according-to-mode)} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- mode: snippet -*- | ||
# name: when else | ||
# key: whene | ||
# -- | ||
when $1 { | ||
${2: $(indent-according-to-mode)} | ||
} else { | ||
${0: $(indent-according-to-mode)} | ||
} |