summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Update vagabond libraryHEADmainBen Bridle4 days
| | | | | | 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.
* Update version to 2.2.2v2.2.2Ben Bridle2025-04-01
|
* Report all symbols involved in a cyclic dependency errorBen Bridle2025-04-01
| | | | | Without this, it's difficult to sort out a cyclic dependency error when many large source files are involved.
* Fix resolver errorBen Bridle2025-04-01
| | | | | | | | | | 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.
* Tidy source codeBen Bridle2025-04-01
|
* Update version to 2.2.1v2.2.1Ben Bridle2025-03-25
|
* Don't print original source in redefinition errorsBen Bridle2025-03-25
| | | | | | | | | 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.
* Update version to 2.2.0v2.2.0Ben Bridle2025-03-18
|
* Large restructureBen Bridle2025-03-18
| | | | | Files were moved to be better organised, error messages were changed to be more general, and a Compiler type was added to the library.
* Update version to 2.1.1v2.1.1Ben Bridle2025-03-18
|
* Fix Tokeniser::end_of_line methodBen Bridle2025-03-17
| | | | | | 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.
* Update version to 2.1.0v2.1.0Ben Bridle2025-03-11
|
* Implement source chainsBen Bridle2025-03-11
| | | | | | | | | | 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.
* Prevent duplicate parent and child entries for source unitsBen Bridle2025-03-11
| | | | | | | | | 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.
* Make output of report_source_issue more conciseBen Bridle2025-03-10
| | | | | Instead of displaying two locations for the same error, only show the in_merged source location if there is no in_source location.
* Implement Borrow and BorrowMut for TrackedBen Bridle2025-03-09
|
* Make Tokeniser::eat_until even more generalBen Bridle2025-03-08
| | | | | | | 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.
* Add Tokeniser::eat_if methodBen Bridle2025-03-08
| | | | | This method is used for consuming a multi-character sequence only if that sequence matches a passed string.
* Implement Hash for TrackedBen Bridle2025-03-08
|
* Ignore source units that have already been includedBen Bridle2025-03-08
| | | | | | | | 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.
* Show an error when a source file fails to parseBen Bridle2025-03-08
| | | | | | | | | | | | | | | | | 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.
* Rename Tokeniser::subtokenise to tokenise_child_spanBen Bridle2025-03-06
| | | | This is a clearer and more descriptive name for the method.
* Make Tokeniser::eat_to_delimiter method more generalBen Bridle2025-03-06
| | | | | | | | | 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.
* Add Tracked typeBen Bridle2025-03-03
| | | | The Tracked type allows tagging an arbitrary type with a SourceSpan.
* Remove unneeded feature attribute from libraryBen Bridle2025-03-03
| | | | The extract_if feature has stabilised and no longer requires nightly.
* Update version to 2.0.1v2.0.1Ben Bridle2025-03-01
|
* Fix compilation on rust nightly 1.87.0Ben Bridle2025-03-01
| | | | The API of the extract_if method has changed to also take a range.
* Update version to 2.0.0v2.0.0Ben Bridle2025-02-27
|
* Change namespace delimiter in symbol debug outputBen Bridle2025-02-27
|
* Rewrite tokeniserBen Bridle2025-02-27
| | | | | This commit adds a subtokenise method that creates a child tokeniser over all characters between the start and end marks.
* Correctly record references resolved by each definitionBen Bridle2025-02-13
| | | | | Definitions were incorrectly not having resolved references associated with them.
* Create struct for reporting unused definitionsBen Bridle2025-02-13
|
* Report redefinition errorsBen Bridle2025-02-13
| | | | | Previously, the Resolver::error method was only checking for undefined symbols, and not also checking for redefined symbols.
* Create struct for reporting in detail the symbols in a resolverBen Bridle2025-02-10
| | | | This is used for debugging symbol definition and resolution issues.
* Definitions can only come from the same or a parent namespaceBen Bridle2025-02-10
| | | | | This commit fixes an error where a reference was being resolved by a definition in a child namespace.
* Track related symbols in resolverBen Bridle2025-02-10
| | | | | | | | 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.
* Import from the log and ansi crates once in the reports moduleBen Bridle2025-02-10
| | | | This is tidier than duplicate imports in every file of the module.
* Simplify infallible indexing operations in resolverBen Bridle2025-02-10
| | | | | 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.
* Move report-printing structs to separate moduleBen Bridle2025-02-10
|
* Add tokeniser method to mark previous char as start of tokenBen Bridle2025-02-10
| | | | | | 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.
* Tidy codeBen Bridle2025-02-09
|
* Rename Position type to SourcePositionBen Bridle2025-02-09
| | | | | | This better matches the naming convention of the other source locator types, and better differentiates a SourcePosition from other kinds of position.
* Log when a source file is merged into the resolverBen Bridle2025-02-08
|
* Support namespaces when resolving symbolsBen Bridle2025-02-08
| | | | | | 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.
* Fix displayed path when discovering librariesBen Bridle2025-02-08
| | | | | The path displayed for each discovered library was the path of the parent directory, not the path of the library file.
* Implement basic namespace support for SymbolsBen Bridle2025-02-08
|
* Implement Copy, Clone, Debug for some typesBen Bridle2025-02-08
|
* Display name of symbol instead of full token in error messagesBen Bridle2025-02-08
| | | | | | | | 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.
* Update version to 1.1.0v1.1.0Ben Bridle2025-02-05
|
* Add logging to gather functionsBen Bridle2025-02-05
| | | | | When gathering source files from paths, log each path traversed or parsed.