feat: add extended language validators and fix tokenizer crash bugs

Expand nimcheck with validators and tokenizers for C, C++, C#, Go, Rust,
Ruby, CSS, SQL, Markdown, Dockerfile, Makefile, Kotlin, Lua, Swift,
TypeScript, and XML. Register all flavors in the validator factory and
improve auto-detection scoring for the new languages.

Fix infinite tokenizer loops that caused OOM kills: closeBracket now
advances position, finishTokenizeStep guards stalled tokenization, and
Jinja/JS tokenizers no longer double-advance on brackets.

Fix block-balance false positives in Lua (for/do) and Ruby (postfix
unless), SQL trailing-comma detection across whitespace, and Makefile
tab literals in test fixtures.
This commit is contained in:
2026-07-15 06:49:45 +02:00
parent df2b327a5d
commit 5a7c24f936
109 changed files with 8811 additions and 121 deletions
+39
View File
@@ -0,0 +1,39 @@
:root {
--color-primary: #2563eb;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
font-family: "Inter", sans-serif;
background: var(--color-bg);
color: var(--color-text);
}
.navbar {
display: flex;
background: linear-gradient(135deg, var(--color-primary), #7c3aed);
}
.btn {
padding: 0.625rem 1.25rem;
border: none;
border-radius: 0.5rem;
cursor: pointer;
transition: background 0.2s ease;
}
@keyframes slideIn {
from { opacity: 0; transform: translateX(-20px); }
to { opacity: 1; transform: translateX(0); }
}
@media (max-width: 600px) {
.navbar {
flex-direction: column;
}
}
+28
View File
@@ -0,0 +1,28 @@
:root {
--color-primary: #2563eb;
}
*,
*::before,
*::after {
box-sizing: border-box;
}
body {
font-family: "Inter", sans-serif;
}
.navbar {
display: flex;
background: linear-gradient(135deg, var(--color-primary), #7c3aed);
}
.btn {
padding: 0.625rem 1.25rem;
border: none;
}
@media (max-width: 600px) {
.navbar
flex-direction: column;
}
+159
View File
@@ -0,0 +1,159 @@
:root {
--color-primary: #2563eb;
--color-primary-hover: #1d4ed8;
--color-bg: #f8fafc;
--color-text: #1e293b;
--color-border: #e2e8f0;
--radius-md: 0.5rem;
--shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--font-sans: "Inter", system-ui, -apple-system, sans-serif;
}
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html {
font-size: 16px;
scroll-behavior: smooth;
}
body {
font-family: var(--font-sans);
background: var(--color-bg);
color: var(--color-text);
line-height: 1.6;
}
.container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1rem;
}
.navbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 1rem 2rem;
background: linear-gradient(135deg, var(--color-primary), #7c3aed);
}
.navbar .logo {
font-size: 1.5rem;
font-weight: 700;
color: #fff;
text-decoration: none;
}
.nav-links {
display: flex;
gap: 1.5rem;
list-style: none;
}
.nav-links a {
color: rgb(255 255 255 / 0.85);
text-decoration: none;
transition: color 0.2s ease;
}
.nav-links a:hover {
color: #fff;
}
.card {
background: #fff;
border: 1px solid var(--color-border);
border-radius: var(--radius-md);
box-shadow: var(--shadow-sm);
padding: 1.5rem;
}
.card__title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 0.75rem;
}
.card__body {
color: #64748b;
}
.btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.625rem 1.25rem;
border: none;
border-radius: var(--radius-md);
font-weight: 500;
cursor: pointer;
transition: background 0.2s ease, transform 0.1s ease;
}
.btn:active {
transform: scale(0.97);
}
.btn--primary {
background: var(--color-primary);
color: #fff;
}
.btn--primary:hover {
background: var(--color-primary-hover);
}
.btn--outline {
background: transparent;
border: 2px solid var(--color-primary);
color: var(--color-primary);
}
.grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 1.5rem;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.animate-in {
animation: fadeIn 0.4s ease-out both;
}
@media (max-width: 768px) {
.navbar {
flex-direction: column;
gap: 1rem;
}
.nav-links {
flex-wrap: wrap;
justify-content: center;
}
.grid {
grid-template-columns: 1fr;
}
}
@media (prefers-color-scheme: dark) {
:root {
--color-bg: #0f172a;
--color-text: #e2e8f0;
--color-border: #334155;
}
.card {
background: #1e293b;
}
}