Skip to content

Commit

Permalink
feat: add JSON support
Browse files Browse the repository at this point in the history
  • Loading branch information
boidolr authored and HerringtonDarkholme committed Feb 3, 2024
1 parent a1d533f commit 1ede9fe
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wasm_lang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub enum WasmLang {
Go,
Html,
Java,
Json,
Kotlin,
Php,
Python,
Expand Down Expand Up @@ -65,6 +66,7 @@ impl FromStr for WasmLang {
"go" => Go,
"html" => Html,
"java" => Java,
"json" => Json,
"kotlin" => Kotlin,
"php" => Php,
"python" => Python,
Expand Down Expand Up @@ -138,6 +140,7 @@ macro_rules! execute_lang_method {
W::Go => L::Go.$method($($pname,)*),
W::Html => L::Html.$method($($pname,)*),
W::Java => L::Java.$method($($pname,)*),
W::Json => L::Json.$method($($pname,)*),
W::Kotlin => L::Kotlin.$method($($pname,)*),
W::JavaScript => L::JavaScript.$method($($pname,)*),
W::Php => L::Php.$method($($pname,)*),
Expand Down
Binary file added website/public/tree-sitter-json.wasm
Binary file not shown.
2 changes: 2 additions & 0 deletions website/src/components/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const parserPaths = {
go: 'tree-sitter-go.wasm',
html: 'tree-sitter-html.wasm',
java: 'tree-sitter-java.wasm',
json: 'tree-sitter-json.wasm',
kotlin: 'tree-sitter-kotlin.wasm',
php: 'tree-sitter-php.wasm',
python: 'tree-sitter-python.wasm',
Expand Down Expand Up @@ -47,6 +48,7 @@ export const languageDisplayNames: Record<SupportedLang, string> = {
go: 'Go',
html: 'HTML',
java: 'Java',
json: 'JSON',
kotlin: 'Kotlin',
php: 'PHP(alpha)',
python: 'Python',
Expand Down

0 comments on commit 1ede9fe

Please sign in to comment.