humalis 1.2.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/fichiers.js CHANGED
@@ -5,6 +5,7 @@ import { ErreurSyntaxique } from './parser/erreurs.js';
5
5
  import { lireCsv } from './donnees/csv.js';
6
6
  import { lireJson } from './donnees/json.js';
7
7
  import { analyserSens } from './analyse/analyse.js';
8
+ import { verifierCss } from './analyse/css.js';
8
9
  import { construireRepresentation } from './ri/construire.js';
9
10
  /**
10
11
  * Plusieurs fichiers (trou G4) : les lignes du k-ième fichier utilisé sont
@@ -158,7 +159,26 @@ export function compilerProjet(principal, lire, sourcePrincipale) {
158
159
  }
159
160
  if (diagnostics.some((d) => d.gravite === 'erreur'))
160
161
  return fin();
161
- const analyse = analyserSens(programme);
162
+ const classesCss = new Set();
163
+ let cssIllisible = false;
164
+ for (const bloc of programme.styles) {
165
+ const resultat = verifierCss(bloc.css, bloc.ligne + 1);
166
+ for (const nom of resultat.classes)
167
+ classesCss.add(nom);
168
+ diagnostics.push(...resultat.diagnostics);
169
+ }
170
+ for (const fichier of programme.fichiersStyle) {
171
+ const contenu = lire(joindre(base, fichier.chemin));
172
+ if (contenu === undefined) {
173
+ cssIllisible = true;
174
+ continue;
175
+ }
176
+ const resultat = verifierCss(contenu, 1, fichier.chemin.replace(/^\.\//, ''));
177
+ for (const nom of resultat.classes)
178
+ classesCss.add(nom);
179
+ diagnostics.push(...resultat.diagnostics);
180
+ }
181
+ const analyse = analyserSens(programme, cssIllisible ? undefined : classesCss);
162
182
  diagnostics.push(...analyse.diagnostics);
163
183
  if (diagnostics.some((d) => d.gravite === 'erreur'))
164
184
  return fin();