<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tools.nes/lib/xixanta/src/lib.rs, branch main</title>
<subtitle>Tools for NES/Famicom development.
</subtitle>
<id>https://git.mssola.com/nes/tools.nes/atom?h=main</id>
<link rel='self' href='https://git.mssola.com/nes/tools.nes/atom?h=main'/>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/'/>
<updated>2026-02-02T18:56:21Z</updated>
<entry>
<title>xixanta: add context from macro expansions</title>
<updated>2026-02-02T18:56:21Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mssola@mssola.com</email>
</author>
<published>2026-02-02T18:56:21Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=930ad1cc4422f19251ea77a625816e3aebcc6eea'/>
<id>urn:sha1:930ad1cc4422f19251ea77a625816e3aebcc6eea</id>
<content type='text'>
The way macro expansions work is that the evaluated bundles replace the
current node, but this throws away the context of the line, the source,
etc. from the original line of code.

Add a stack that is pushed/popped when expanding macros, and are then
cloned for each pending node and error. This way, errors have full
context of the original code and can display backtraces for macro
expansion.

Signed-off-by: Miquel Sabaté Solà &lt;mssola@mssola.com&gt;
</content>
</entry>
<entry>
<title>Drop lazy_static dependency</title>
<updated>2025-01-22T21:38:33Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2025-01-22T21:38:33Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=9660a01f4bcc514b70fe83fb64dc91659cf2bfa2'/>
<id>urn:sha1:9660a01f4bcc514b70fe83fb64dc91659cf2bfa2</id>
<content type='text'>
Apparently the standard library had LazyLock which is enough for what I
wanted to achieve with lazy_static.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Add support for cfg files</title>
<updated>2025-01-13T15:15:06Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2025-01-13T15:12:08Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=5f48de69f46d4da27b22c47178b2e6216f7a7801'/>
<id>urn:sha1:5f48de69f46d4da27b22c47178b2e6216f7a7801</id>
<content type='text'>
In order to make tools like `xa65` work seamlessly with existing
configurations, allow this format too instead of making developers
switch to a new file with TOML syntax.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Rename SourceInfo::working_directory to directory</title>
<updated>2025-01-09T15:32:34Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2025-01-09T15:32:34Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=a4a68fdb178722e23e007b1f6bf72474caae4e97'/>
<id>urn:sha1:a4a68fdb178722e23e007b1f6bf72474caae4e97</id>
<content type='text'>
Also documented the struct as it is exported.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Merge all error types into a single one</title>
<updated>2025-01-09T15:30:01Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2025-01-09T15:26:20Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=92092ccc245269e0c3a864d06f7e382a5bb9d8b0'/>
<id>urn:sha1:92092ccc245269e0c3a864d06f7e382a5bb9d8b0</id>
<content type='text'>
They started with good intentions, but in the end they were all pretty
much alike. Hence, it makes sense to simplify everything and provide a
single struct.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Implement the .include statement</title>
<updated>2025-01-09T15:01:39Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2025-01-08T11:34:47Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=8b1c270910fce13077864bf39d6e88971a6eb062'/>
<id>urn:sha1:8b1c270910fce13077864bf39d6e88971a6eb062</id>
<content type='text'>
This needed some heavy lifting when it comes to how files were located.
This means that statements like .include/.incbin now take into
consideration a new list made out of SourceInfo, which holds enough
information to translate from which file a node comes from. This has
also been added into errors, so they are more informative on what went
wrong.

In order to tests this, besides all the regular unit tests, a new e2e
test has been added.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Fix the mapping of addresses on labels</title>
<updated>2024-12-16T15:10:15Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-12-16T14:46:21Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=1d0bb4d384d391b5603622d813a63cb192e0defb'/>
<id>urn:sha1:1d0bb4d384d391b5603622d813a63cb192e0defb</id>
<content type='text'>
There was a big missunderstanding on how things were to be laid out in
the end file, and so it was needed to create a proper understanding on
what's a Mapping and what's a Segment. These turned out to be
fundamental concepts that I failed to grok up until this commit.

Hence, this commit re-arranges completely how variables and labels are
stored in the Context, and how these objects can then be translated into
bundles that can be spit out to the caller.

This commit, besides introducing the new Mapping struct, also introduced
a more general Object, which abstracts things from the Bundle struct,
and allows us to pass certain metadata about the bundle at hand.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Adapt the assembler to the changes on the parser</title>
<updated>2024-12-12T06:46:17Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-10-09T13:41:30Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=16114b2ca358dbbef09cb5a8d3a843a0e11a3b88'/>
<id>urn:sha1:16114b2ca358dbbef09cb5a8d3a843a0e11a3b88</id>
<content type='text'>
As of 184c39579227 ("Re-work the parser from scratch") the parser has a
proper AST, and the assembler has to traverse it accordingly.

Moreover, the assembler has been stripped from a lot of unneeded memory
allocations and it's overall more keen on using mere references when
possible.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Re-work the parser from scratch</title>
<updated>2024-12-12T06:41:30Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-09-26T13:53:57Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=184c39579227c0add80a61d489c242120001d6b6'/>
<id>urn:sha1:184c39579227c0add80a61d489c242120001d6b6</id>
<content type='text'>
The initial implementation was incredibly naive on how complex an
assembler can actually be. Because of this, it never bothered to define
and produce a proper AST, and hence it was overall extremely fragile on
(not so) corner cases.

This commit re-writes everything from scratch for the parser, and it
should really be the last fundamental change to the parser other than
minor additions/features here and there.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
<entry>
<title>Add the notion of mapping</title>
<updated>2024-12-12T06:31:52Z</updated>
<author>
<name>Miquel Sabaté Solà</name>
<email>mikisabate@gmail.com</email>
</author>
<published>2024-07-15T06:55:57Z</published>
<link rel='alternate' type='text/html' href='https://git.mssola.com/nes/tools.nes/commit/?id=c6c9aa4e5f3e5a01fcb9ccabf6dbd2f6da277650'/>
<id>urn:sha1:c6c9aa4e5f3e5a01fcb9ccabf6dbd2f6da277650</id>
<content type='text'>
Mappings and segments are fundamental blocks on how code is distributed
both on the actual ROM File and in the memory layout.

Signed-off-by: Miquel Sabaté Solà &lt;mikisabate@gmail.com&gt;
</content>
</entry>
</feed>
