Skip to content

Commit

Permalink
Revise path resolution yet again
Browse files Browse the repository at this point in the history
* Abandon the old algorithm
* Base algorithm on finding the "anchor" node in the model
* Anchor node can be:
  * "Root" (root of model),
  * First Ancestor (of the PathId) that matches PathId first element
  * A unique element in the SymTab that matches PathId first element
* Don't resolve every path reference every time, use the resolution
  map built so far to resolve common paths.
* Refactor into functions with names that make sense
* Still passes all path resolution tests in all modules.

Signed-off-by: reidspencer <reid.spencer@yoppworks.com>
  • Loading branch information
reid-spencer committed Sep 29, 2023
1 parent 8e311c6 commit c015c83
Show file tree
Hide file tree
Showing 5 changed files with 260 additions and 83 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ case class CommonOptions(
verbose: Boolean = false,
dryRun: Boolean = false,
quiet: Boolean = false,
// FIXME: Add this and its reader, etc: showInfoMessages: Boolean = true,
// TODO: Add a "maxParallelParsing" option to limit parallel included file parsing (not implemented yet)
showWarnings: Boolean = true,
showMissingWarnings: Boolean = true,
showStyleWarnings: Boolean = true,
Expand All @@ -20,7 +22,7 @@ case class CommonOptions(
pluginsDir: Option[Path] = None,
sortMessagesByLocation: Boolean = false,
groupMessagesByKind: Boolean = true,
noANSIMessages: Boolean = false,
noANSIMessages: Boolean = false
)

object CommonOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ object Messages {
msgs.isEmpty || !msgs.exists(_.kind >= Warning)
}
def hasErrors: Boolean = { msgs.nonEmpty && msgs.exists(_.kind >= Error) }
def justInfo: Messages = msgs.filter(_.isInfo)
def justMissing: Messages = msgs.filter(_.isMissing)
def justStyle: Messages = msgs.filter(_.isStyle)
def justUsage: Messages = msgs.filter(_.isUsage)
Expand Down Expand Up @@ -308,6 +309,7 @@ object Messages {
if commonOptions.showUsageWarnings then {
msgs.append(msg)
}
// FIXME: filter out Info messages if commonOptions.showInfoMssages is false
case _ => msgs.append(msg)
}
this
Expand Down
Loading

0 comments on commit c015c83

Please sign in to comment.