Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Mixed tab/space indentation: lexer and formatter measure width differently

Aperta
#1,370 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
c
Ambito
compilers

Direzione di ricerca

Start with src/fmt.c and its measure_indent function, then locate the lexer's leading-whitespace measurement. Decide whether both should share one indentation-width rule or mixed tabs and spaces should be rejected. Add tests using the same mixed-indent files for parsing and formatting, and verify the file produces identical output before and after --fmt.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area:lint-tooling kind:silent-wrong

Found by the builder on #1368.

The lexer measures leading whitespace without tab stops. \t measures 6 (2 + 4). In \t \t, the second tab is not counted, giving width 5, so \t \t followed by \t raises "unexpected indent". src/fmt.c measure_indent uses tab stops of 4. So the lexer and the formatter can disagree about the block structure of a mixed-indent file, and --fmt could re-indent a file into a different program.

Done when

  • The lexer and fmt share ONE indentation-width function (or the language refuses mixed tab/space indentation outright, with a stated rule).
  • A test feeds the same mixed-indent files to both and asserts the same block structure; running the file before and after --fmt prints the same output.
Lingua principale
C
Stelle
3
Fork
7
Merge medio
4h 5m
PR unite (30g)
116

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di InauguralSystems/EigenScript

Tutte le issue di InauguralSystems/EigenScript

Issue simili

Altre issue su C

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.