Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#1,370 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
c
Área
compilers

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
C
Estrellas
3
Forks
7
Merge medio
4 h 5 min
PR fusionados (30 d)
116

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de InauguralSystems/EigenScript

Todos los issues de InauguralSystems/EigenScript

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.