Skip to content

Commit

Permalink
Refactor source parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
chances committed Feb 10, 2024
1 parent 9734e43 commit 40500d1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cli.wren
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@ Ensure.exec("touch", [Path.join([cwd, "docs", "index.json"])])

// Find Wren sources
// TODO: Recursivly search for sources, ignoring "wren_modules" directories
var sources = Directory.list(cwd).where {|entry|
var sources = {}
Directory.list(cwd).where {|entry|
return entry.endsWith(".wren") && File.exists(entry)
}.map {|entry|
}.each {|entry|
var path = Path.join([cwd, entry])
return Analyzer.parse(path, File.read(path))
}.toList
sources[path] = Analyzer.parse(path, File.read(path))
}
System.print("Parsed %(sources.keys.count) modules")
// TODO: Read all *.wren files, parse symbols and neighboring comments, emit docs

// NOTE: "There is a convention that methods ending in "_" are private." See https://github.com/wren-lang/wren/issues/117 and https://github.com/wren-lang/wren/issues/498#issuecomment-376209364

0 comments on commit 40500d1

Please sign in to comment.