-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
00d766c
commit f1978d3
Showing
6 changed files
with
137 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
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,51 @@ | ||
/** | ||
* @typedef {import("../../../shared/meta.js").Meta} Meta | ||
* @typedef {import("../../colors/themes.js").Syntax} Syntax | ||
*/ | ||
|
||
/** | ||
* @returns {Meta} | ||
*/ | ||
export function meta() { | ||
return { | ||
title: "fish", | ||
name: "fish", | ||
scope: "source.fish", | ||
grammars: ["https://github.com/bmalehorn/vscode-fish/blob/2bdcfbea62cadc2a977eace3189d25b31df71e72/syntaxes/fish.tmLanguage.json/"], | ||
example: { | ||
author: { | ||
name: "Jorge Bucaran", | ||
url: "https://github.com/jorgebucaran/" | ||
}, | ||
source: { | ||
name: "A plugin manager for Fish", | ||
url: "https://github.com/jorgebucaran/fisher/blob/4.4.4/functions/fisher.fish/" | ||
} | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* @param {Syntax} s | ||
* @returns {Record<string, string>} | ||
*/ | ||
export function tokenColors(s) { | ||
const c0 = s.comment[0] | ||
const p0 = s.plain[0] | ||
const p1 = s.plain[1] | ||
const s0 = s.string[0] | ||
const s1 = s.string[1] | ||
|
||
return { | ||
"comment.line.number-sign.fish": c0, | ||
"keyword.control.fish": p0, | ||
"punctuation.definition.string.begin.fish": s0, | ||
"punctuation.definition.string.end.fish": s0, | ||
"punctuation.definition.variable.fish": p0, | ||
"source.fish": p1, | ||
"string.quoted.double.fish": s1, | ||
"string.quoted.single.fish": s1, | ||
"variable.language.fish": p1, | ||
"variable.other.normal.fish": p1 | ||
} | ||
} |
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,4 @@ | ||
import {t} from "../../../shared/test.js" | ||
import * as s from "./fish.js" | ||
|
||
await t(s, import.meta.url) |
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,28 @@ | ||
# comment | ||
|
||
s | ||
$s | ||
$argv | ||
|
||
"s$s$argv" | ||
's' | ||
|
||
function | ||
while | ||
if | ||
else | ||
switch | ||
case | ||
for | ||
in | ||
begin | ||
end | ||
continue | ||
break | ||
return | ||
source | ||
exit | ||
wait | ||
and | ||
or | ||
not |
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,49 @@ | ||
/** | ||
* @typedef {import("hast").Root} Root | ||
* @typedef {import("../../../../colors/themes.js").Syntax} Syntax | ||
*/ | ||
|
||
import {r, w} from "../../../../../shared/test.js" | ||
|
||
/** | ||
* @param {Syntax} s | ||
* @returns {Root} | ||
*/ | ||
export function fn(s) { | ||
const c0 = w(s.comment[0]) | ||
const p0 = w(s.plain[0]) | ||
const p1 = w(s.plain[1]) | ||
const s0 = w(s.string[0]) | ||
const s1 = w(s.string[1]) | ||
|
||
return r( | ||
c0("# comment"), | ||
|
||
p1("s"), | ||
p0("$"), p1("s"), | ||
p0("$"), p1("argv"), | ||
|
||
s0('"'), s1("s"), p0("$"), p1("s"), p0("$"), p1("argv"), s0('"'), | ||
s0("'"), s1("s"), s0("'"), | ||
|
||
p0("function"), | ||
p0("while"), | ||
p0("if"), | ||
p0("else"), | ||
p0("switch"), | ||
p0("case"), | ||
p0("for"), | ||
p0("in"), | ||
p0("begin"), | ||
p0("end"), | ||
p0("continue"), | ||
p0("break"), | ||
p0("return"), | ||
p0("source"), | ||
p0("exit"), | ||
p0("wait"), | ||
p0("and"), | ||
p0("or"), | ||
p0("not") | ||
) | ||
} |
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