Skip to content

Commit cdbfd5c

Browse files
committed
feat: add language solidity
1 parent b9c2627 commit cdbfd5c

13 files changed

Lines changed: 244 additions & 111 deletions

LANGUAGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@
7676
- [x] Nix (`nix`)
7777
- [x] HCL (`hcl`)
7878
- [x] Razor (`razor`)
79+
- [x] Solidity (`solidity`)
7980

8081
## Pending
8182

@@ -86,7 +87,6 @@
8687
- [ ] Protocol Buffers (`protobuf`)
8788
- [ ] Racket (`racket`)
8889
- [ ] Rego (`rego`)
89-
- [ ] Solidity (`solidity`)
9090
- [ ] TeX (`tex`)
9191
- [ ] Twig (`twig`)
9292
- [ ] XQuery (`xquery`)

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ import { razor } from "code-languages/razor";
101101
import { ruby } from "code-languages/ruby";
102102
import { scala } from "code-languages/scala";
103103
import { scss } from "code-languages/scss";
104+
import { solidity } from "code-languages/solidity";
104105
import { json } from "code-languages/json";
105106
import { sql } from "code-languages/sql";
106107
import { svg } from "code-languages/svg";
@@ -171,6 +172,7 @@ console.log(razor.extensions);
171172
console.log(ruby.website);
172173
console.log(scala.version);
173174
console.log(scss.extensions);
175+
console.log(solidity.version);
174176
console.log(json.i18n.en.description);
175177
console.log(sql.i18n.en.name);
176178
console.log(svg.extensions);
@@ -247,6 +249,7 @@ import {
247249
ruby,
248250
scala,
249251
scss,
252+
solidity,
250253
sql,
251254
svg,
252255
svn,
@@ -316,6 +319,7 @@ console.log(localizeLanguage(razor, "es").description);
316319
console.log(localizeLanguage(ruby, "es").description);
317320
console.log(localizeLanguage(scala, "es").description);
318321
console.log(localizeLanguage(scss).name);
322+
console.log(localizeLanguage(solidity, "es").description);
319323
console.log(json.website);
320324
console.log(sql.extensions);
321325
console.log(localizeLanguage(svg, "es").description);
@@ -480,6 +484,7 @@ console.log(detectLanguages("include/config.h").map((language) => language.slug)
480484
| <img src="https://www.rust-lang.org/logos/rust-logo-512x512.png" alt="Rust logo" width="24" height="24"> | Rust | `rust` | `.rs` | `1.95.0` | `code-languages/rust` |
481485
| <img src="https://cdn.simpleicons.org/scala/DC322F" alt="Scala logo" width="24" height="24"> | Scala | `scala` | `.scala`, `.sc` | `3.8.3` | `code-languages/scala` |
482486
| <img src="https://sass-lang.com/assets/img/logos/logo.svg" alt="Sass logo" width="24" height="24"> | Sass | `scss` | `.scss`, `.sass` | `1.99.0` | `code-languages/scss` |
487+
| <img src="https://cdn.simpleicons.org/solidity/363636" alt="Solidity logo" width="24" height="24"> | Solidity | `solidity` | `.sol` | `0.8.35` | `code-languages/solidity` |
483488
| <img src="https://upload.wikimedia.org/wikipedia/commons/8/87/Sql_data_base_with_logo.png" alt="SQL logo" width="24" height="24"> | SQL | `sql` | `.sql` | `SQL:2023` | `code-languages/sql` |
484489
| <img src="https://upload.wikimedia.org/wikipedia/commons/4/4f/SVG_Logo.svg" alt="SVG logo" width="24" height="24"> | SVG | `svg` | `.svg`, `.svgz` | `SVG 2` | `code-languages/svg` |
485490
| <img src="https://cdn.simpleicons.org/subversion/809CC9" alt="SVN logo" width="24" height="24"> | SVN | `svn` | `.svn`, `svnserve.conf` | `1.14.5` | `code-languages/svn` |

docs/data/bench-results.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
11
{
2-
"generatedAt": "2026-05-15T12:12:12.193Z",
2+
"generatedAt": "2026-05-15T12:20:28.087Z",
33
"runtime": "v25.9.0",
44
"results": [
55
{
66
"name": "detectLanguage for TypeScript file",
77
"group": "detect",
88
"iterations": 100000,
9-
"totalMs": 167.164,
10-
"meanMs": 0.001672,
11-
"opsPerSecond": 598215
9+
"totalMs": 171.712,
10+
"meanMs": 0.001717,
11+
"opsPerSecond": 582370
1212
},
1313
{
1414
"name": "detectLanguages for ambiguous header",
1515
"group": "detect",
1616
"iterations": 100000,
17-
"totalMs": 175.059,
18-
"meanMs": 0.001751,
19-
"opsPerSecond": 571235
17+
"totalMs": 177.872,
18+
"meanMs": 0.001779,
19+
"opsPerSecond": 562201
2020
},
2121
{
2222
"name": "detectLanguage mixed filenames",
2323
"group": "detect",
2424
"iterations": 20000,
25-
"totalMs": 40.98,
26-
"meanMs": 0.002049,
27-
"opsPerSecond": 488044
25+
"totalMs": 40.744,
26+
"meanMs": 0.002037,
27+
"opsPerSecond": 490868
2828
},
2929
{
3030
"name": "localize TypeScript to es-PE",
3131
"group": "i18n",
3232
"iterations": 250000,
33-
"totalMs": 61.665,
34-
"meanMs": 0.000247,
35-
"opsPerSecond": 4054183
33+
"totalMs": 59.051,
34+
"meanMs": 0.000236,
35+
"opsPerSecond": 4233596
3636
},
3737
{
3838
"name": "localize complete catalog to Spanish",
3939
"group": "i18n",
4040
"iterations": 10000,
41-
"totalMs": 209.7,
42-
"meanMs": 0.02097,
43-
"opsPerSecond": 47687
41+
"totalMs": 209.059,
42+
"meanMs": 0.020906,
43+
"opsPerSecond": 47833
4444
},
4545
{
4646
"name": "api.language().locale().get()",
4747
"group": "api",
4848
"iterations": 100000,
49-
"totalMs": 46.617,
50-
"meanMs": 0.000466,
51-
"opsPerSecond": 2145150
49+
"totalMs": 46.48,
50+
"meanMs": 0.000465,
51+
"opsPerSecond": 2151455
5252
},
5353
{
5454
"name": "api.detect().locale().get()",
5555
"group": "api",
5656
"iterations": 100000,
57-
"totalMs": 211.893,
58-
"meanMs": 0.002119,
59-
"opsPerSecond": 471936
57+
"totalMs": 199.748,
58+
"meanMs": 0.001997,
59+
"opsPerSecond": 500630
6060
},
6161
{
6262
"name": "api.language().locale().load()",
6363
"group": "api",
6464
"iterations": 10000,
65-
"totalMs": 4.691,
66-
"meanMs": 0.000469,
67-
"opsPerSecond": 2131742
65+
"totalMs": 4.666,
66+
"meanMs": 0.000467,
67+
"opsPerSecond": 2142953
6868
}
6969
]
7070
}

docs/data/languages.json

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"generatedAt": "2026-05-15T12:12:12.391Z",
3-
"total": 73,
4-
"extensions": 215,
2+
"generatedAt": "2026-05-15T12:20:28.309Z",
3+
"total": 75,
4+
"extensions": 218,
55
"locales": ["en", "es"],
66
"languages": [
77
{
@@ -1133,6 +1133,27 @@
11331133
"version": "4.6.0",
11341134
"logo": "https://www.r-project.org/logo/Rlogo.svg"
11351135
},
1136+
{
1137+
"slug": "razor",
1138+
"name": "Razor",
1139+
"description": "Microsoft's markup syntax for ASP.NET Core views, Razor Pages, and Blazor components.",
1140+
"longDescription": "Razor is a markup syntax and templating language used by ASP.NET Core to combine HTML with C# expressions, directives, layouts, tag helpers, components, and server-side or interactive rendering logic.\n\nIt is used in MVC views, Razor Pages, Razor Class Libraries, and Blazor components. Razor files commonly define page templates, reusable UI components, forms, layouts, routing, component parameters, and bindings within .NET web applications.",
1141+
"esName": "Razor",
1142+
"esDescription": "La sintaxis de marcado de Microsoft para vistas ASP.NET Core, Razor Pages y componentes Blazor.",
1143+
"esLongDescription": "Razor es una sintaxis de marcado y lenguaje de templates usado por ASP.NET Core para combinar HTML con expresiones C#, directivas, layouts, tag helpers, componentes y logica de renderizado server-side o interactiva.\n\nSe usa en vistas MVC, Razor Pages, Razor Class Libraries y componentes Blazor. Los archivos Razor suelen definir templates de paginas, componentes UI reutilizables, formularios, layouts, routing, parametros de componentes y bindings dentro de aplicaciones web .NET.",
1144+
"publishedDate": "2010-07-01",
1145+
"extensions": [".cshtml", ".razor"],
1146+
"author": "Microsoft",
1147+
"website": "https://learn.microsoft.com/en-us/aspnet/core/mvc/views/razor",
1148+
"paradigms": ["templating", "component-based", "server-side", "declarative"],
1149+
"tooling": {
1150+
"runtimes": ["ASP.NET Core", ".NET", "Blazor"],
1151+
"packageManagers": ["NuGet"],
1152+
"ecosystems": [".NET", "ASP.NET Core", "Web", "Blazor"]
1153+
},
1154+
"version": "10.0.8",
1155+
"logo": "https://cdn.simpleicons.org/dotnet/512BD4"
1156+
},
11361157
{
11371158
"slug": "ruby",
11381159
"name": "Ruby",
@@ -1217,6 +1238,27 @@
12171238
"version": "3.8.3",
12181239
"logo": "https://cdn.simpleicons.org/scala/DC322F"
12191240
},
1241+
{
1242+
"slug": "solidity",
1243+
"name": "Solidity",
1244+
"description": "A statically typed smart contract language for Ethereum and EVM-compatible blockchains.",
1245+
"longDescription": "Solidity is a statically typed, contract-oriented programming language designed for writing smart contracts that run on the Ethereum Virtual Machine and compatible blockchain networks. It supports contracts, libraries, interfaces, inheritance, modifiers, events, custom errors, ABI encoding, and explicit visibility and mutability rules.\n\nIt is used to build decentralized applications, token contracts, DAOs, DeFi protocols, NFT contracts, governance systems, and other on-chain programs where deterministic execution and verifiable state transitions are required.",
1246+
"esName": "Solidity",
1247+
"esDescription": "Un lenguaje tipado estaticamente para smart contracts en Ethereum y blockchains compatibles con EVM.",
1248+
"esLongDescription": "Solidity es un lenguaje de programacion tipado estaticamente y orientado a contratos, disenado para escribir smart contracts que se ejecutan en Ethereum Virtual Machine y redes blockchain compatibles. Soporta contratos, bibliotecas, interfaces, herencia, modificadores, eventos, errores personalizados, codificacion ABI y reglas explicitas de visibilidad y mutabilidad.\n\nSe usa para construir aplicaciones descentralizadas, contratos de tokens, DAOs, protocolos DeFi, contratos NFT, sistemas de gobernanza y otros programas on-chain donde se requiere ejecucion determinista y transiciones de estado verificables.",
1249+
"publishedDate": "2015-07-30",
1250+
"extensions": [".sol"],
1251+
"author": "Gavin Wood / Ethereum Foundation / Solidity Team",
1252+
"website": "https://soliditylang.org",
1253+
"paradigms": ["contract-oriented", "object-oriented", "statically-typed", "imperative"],
1254+
"tooling": {
1255+
"runtimes": ["Ethereum Virtual Machine", "EVM-compatible chains"],
1256+
"packageManagers": ["npm", "Foundry", "Hardhat"],
1257+
"ecosystems": ["Ethereum", "Web3", "Smart Contracts", "Blockchain"]
1258+
},
1259+
"version": "0.8.35",
1260+
"logo": "https://cdn.simpleicons.org/solidity/363636"
1261+
},
12201262
{
12211263
"slug": "sql",
12221264
"name": "SQL",

0 commit comments

Comments
 (0)