summaryrefslogtreecommitdiff
path: root/src/source_unit.rs
Commit message (Collapse)AuthorAge
* 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.
* Change namespace delimiter in symbol debug outputBen Bridle2025-02-27
|
* 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.
* 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
|
* Add logging to gather functionsBen Bridle2025-02-05
| | | | | When gathering source files from paths, log each path traversed or parsed.
* Allow loading a source unit from a path with any extensionBen Bridle2025-02-05
| | | | | | | | Previously, the extension of a source file had to match the provided extension. This was unnecessarily limited, and prevented arbitrary text files from being passed as source files. If no extension is provided, any file can be loaded as a source file.
* Implement source unit compilation, symbol resolution, error reportingBen Bridle2025-02-05
This library can now carry out all stages of assembly from collecting source fragments to resolving symbols to pruning unused libraries to generating a single compiled source file. Pretty-printing of state has also been implemented in this library. The source tree hierarchy, symbol resolution errors, and file read errors can all be printed in a tidy format.