| Commit message (Collapse) | Author | Age |
|
|
|
|
|
| |
The latest version 1.1.1 of vagabond removes all nightly features,
which will allow all projects using the assembler library to compile
on stable Rust once the extract_if feature is stabilised.
|
| |
|
|
|
|
|
| |
Without this, it's difficult to sort out a cyclic dependency error when
many large source files are involved.
|
|
|
|
|
|
|
|
|
|
| |
To check if a particular definition was defining a particular symbol,
the names of the definition and reference were being compared, when the
namespace-aware Symbol::defines method should have been used instead.
This was causing an issue where a namespaced definition would be marked
as resolving a with the same name in a different namespace. This was
resulting in a very complicated and incorrect cyclic dependency error.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
The source context of the original definition of a redefined symbol was
being printed when reporting a redefinition error. Since only the
source code containing the redefinition was available, if the original
definition was in a different file then the source context of the
original definition would just pull from this source code and the
context shown would be completely nonsensical.
|
| |
|
|
|
|
|
| |
Files were moved to be better organised, error messages were changed to
be more general, and a Compiler type was added to the library.
|
| |
|
|
|
|
|
|
| |
The method hadn't been changed since back when the chars field was a
stack of characters that were removed as they were consumed. The method
now works with the current design of the Tokeniser.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
A SourceSpan can now contain a child SourceSpan, ad infinitum, in order
to represent a chain of locations. The report_source_issue function
has been changed to print the entire chain, instead of just one
SourceSpan.
The report_source_issue function has also been changed to correctly
print SourceSpans that extend across multiple source lines.
|
|
|
|
|
|
|
|
|
| |
The parent and child collections for hierarchical source units were
previously vecs, and would receive one entry for every symbol matched.
This was easily leading to many dozens of duplicate entries per unit,
which, while not impacting performance, seemed wasteful. The collection
types were changed to HashSets to prevent the collection of duplicate
entries.
|
|
|
|
|
| |
Instead of displaying two locations for the same error, only show the
in_merged source location if there is no in_source location.
|
| |
|
|
|
|
|
|
|
| |
The eat_until method of Tokeniser has been renamed to track_until, and
it no longer consumes characters by itself. The predicate closure is no
longer limited to checking one character at a time, it can look ahead
for multi-character sequences when used with the new eat_if method.
|
|
|
|
|
| |
This method is used for consuming a multi-character sequence only if
that sequence matches a passed string.
|
| |
|
|
|
|
|
|
|
|
| |
There is the possibility that the same source file could be discovered
twice, if the same folder is included multiple times as a library folder
or if symbolic links are used that link to already-included files. These
duplicate source files are now ignored, to prevent erroneous 'duplicate
definition' errors from being generated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, if a source file failed to parse, no symbols would be
returned and symbol resolution would continue as normal. This would
obscure the source of any errors, as well as the fact that any error
had occurred at all.
We don't want all errors in all source files to be printed at symbol
resolution time, because this could bury any errors in the actual
program being assembled with potentially irrelevant library errors,
and errors in the program being assembled will be printed all over
again once a merged source file has been produced.
Instead, we allow the parser function to return a None value if the
file could not be parsed, and a single line is printed as a warning
for every library file that failed to parse.
|
|
|
|
| |
This is a clearer and more descriptive name for the method.
|
|
|
|
|
|
|
|
|
| |
The eat_to_delimiter method on Tokeniser has been renamed to eat_until,
and it now consumes characters until a predicate returns true, not just
until a particular character is reached. This means that the method
can now be passed a closure that keeps track of nesting depth, and only
returns true when a matching delimiter is found at the same level as
the opening delimiter.
|
|
|
|
| |
The Tracked type allows tagging an arbitrary type with a SourceSpan.
|
|
|
|
| |
The extract_if feature has stabilised and no longer requires nightly.
|
| |
|
|
|
|
| |
The API of the extract_if method has changed to also take a range.
|
| |
|
| |
|
|
|
|
|
| |
This commit adds a subtokenise method that creates a child tokeniser
over all characters between the start and end marks.
|
|
|
|
|
| |
Definitions were incorrectly not having resolved references associated
with them.
|
| |
|
|
|
|
|
| |
Previously, the Resolver::error method was only checking for undefined
symbols, and not also checking for redefined symbols.
|
|
|
|
| |
This is used for debugging symbol definition and resolution issues.
|
|
|
|
|
| |
This commit fixes an error where a reference was being resolved by a
definition in a child namespace.
|
|
|
|
|
|
|
|
| |
As well as the already-implemented tracking of the existing definition
of redefinitions, the resolver will now also track the definition that
resolves each reference, and the references resolved by each definition.
Instead of using tuples to hold this information, named wrapper structs
have been created for each category.
|
|
|
|
| |
This is tidier than duplicate imports in every file of the module.
|
|
|
|
|
| |
Indexing into a resolver with a pointer from the same resolver should
never fail, and if it does we don't want to silently squash the error.
|
| |
|
|
|
|
|
|
| |
This enables a parsing technique where characters can be marked as
the start of a token after they've been eaten, instead of having to
determine ahead of time via defensively peeking.
|
| |
|
|
|
|
|
|
| |
This better matches the naming convention of the other source locator
types, and better differentiates a SourcePosition from other kinds of
position.
|
| |
|
|
|
|
|
|
| |
A definition can resolve a reference in the same or a deeper namespace,
allowing for proper scoping and shadowing. Multiple definitions in the
same namespace cannot share a name.
|
|
|
|
|
| |
The path displayed for each discovered library was the path of the
parent directory, not the path of the library file.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
When reporting an undefined symbol, the full token string of the symbol
was being displayed. This was fine for Bedrock, which had at most one
symbol per token, but for Torque you can have multiple symbols
extracted from the same source string. The symbol name is displayed
instead.
|
| |
|
|
|
|
|
| |
When gathering source files from paths, log each path traversed or
parsed.
|