fix: parser newline handling in lists and stdlib exports

- Fix parse_list_expr to skip newlines between list elements
- Add `pub` keyword to all exported functions in stdlib/html.lux
- Change List.foldl to List.fold (matching built-in name)
- Update weaknesses document with fixed issues

The module import system now works correctly. This enables:
- import stdlib/html to work as expected
- html.div(), html.render() etc. to be accessible
- Multi-line list expressions in Lux source files

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-16 06:51:37 -05:00
parent 552e7a4972
commit 4b553031fd
3 changed files with 138 additions and 115 deletions

View File

@@ -2266,12 +2266,15 @@ impl Parser {
fn parse_list_expr(&mut self) -> Result<Expr, ParseError> {
let start = self.current_span();
self.expect(TokenKind::LBracket)?;
self.skip_newlines();
let mut elements = Vec::new();
while !self.check(TokenKind::RBracket) {
elements.push(self.parse_expr()?);
self.skip_newlines();
if !self.check(TokenKind::RBracket) {
self.expect(TokenKind::Comma)?;
self.skip_newlines();
}
}