You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on doc gen (#21) I discovered that there is special code in the tokenizer state machine to "wrap up" the current state when EOF is encountered (stage1 and std/zig/tokenizer).
The logic here to terminate certain tokens or raise errors is duplicated from the main loop.
This final, extra state handler is a place where discrepancies or accidentally omitted cases could be introduced when updating tokenizer rules.
When I see a diff with no trailing newline, I cry. Just a drop, but all those tears add up.
🚫 ↩️ 😢
Inspired by #663 and feeling brassy, I thought I'd propose one further source file encoding requirement: The final character must be LF (0x0A).
Benefits:
Simpler tokenizing logic: upon EOF, no need to handle unterminated tokens.
Increases source code uniformity and minor accidental diff noise.
Downsides:
Adds one more rule to source file validation (not sure of the status in stage1; according to Zig source encoding #663 self-hosted is compliant).
Adds a new restriction by which the programmer/editor must abide.
Questions from newcomers and those who have not configured their editors.
Unconventional.
Neutral:
This restriction on the programmer/editor would be the same level of severity as The Hard Tabs Issue #544, and just as easy for them to acquiesce, so we have a precedent.
While working on doc gen (#21) I discovered that there is special code in the tokenizer state machine to "wrap up" the current state when EOF is encountered (stage1 and std/zig/tokenizer).
🚫 ↩️ 😢
Inspired by #663 and feeling brassy, I thought I'd propose one further source file encoding requirement: The final character must be LF (
0x0A).Benefits:
Downsides:
Neutral: