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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user