<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rep.git/grammar/src, branch master</title>
<subtitle>Parser generator for Emacs written in Rust
</subtitle>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/'/>
<entry>
<title>new start</title>
<updated>2026-10-16T06:02:10+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2026-10-16T06:01:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=fba9a90cfc6aca2a26cce72f55fb261789139781'/>
<id>fba9a90cfc6aca2a26cce72f55fb261789139781</id>
<content type='text'>
Now I tested and discussed with claude, and had a working version of
this project.  The rest is to port the claude version to my own
writings.  So this serves as the starting point before that attempt.

In the new attempt the design is better, and a number of bugs were
found and supposedly fixed, so let us see how this goes at the end.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now I tested and discussed with claude, and had a working version of
this project.  The rest is to port the claude version to my own
writings.  So this serves as the starting point before that attempt.

In the new attempt the design is better, and a number of bugs were
found and supposedly fixed, so let us see how this goes at the end.
</pre>
</div>
</content>
</entry>
<entry>
<title>grammar: cancel the plan of adding a range type</title>
<updated>2023-07-30T03:35:25+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-07-30T03:35:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=a18887835bbb6d6c92c17bbf2d25f8825830a4d0'/>
<id>a18887835bbb6d6c92c17bbf2d25f8825830a4d0</id>
<content type='text'>
I think I should make a new sub-crate dedicated to the tokenization
process instead.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I think I should make a new sub-crate dedicated to the tokenization
process instead.
</pre>
</div>
</content>
</entry>
<entry>
<title>abnf: Correct error reports</title>
<updated>2023-07-21T08:19:04+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-07-21T08:19:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=1f010ad1aad8202828ab437ecaf1a635adda3c3f'/>
<id>1f010ad1aad8202828ab437ecaf1a635adda3c3f</id>
<content type='text'>
Previously the errors emitted while reading abnf grammars reported
incorrect indices.  Now this is fixed.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously the errors emitted while reading abnf grammars reported
incorrect indices.  Now this is fixed.
</pre>
</div>
</content>
</entry>
<entry>
<title>Derive Debug for a type</title>
<updated>2023-07-21T08:18:18+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-07-21T08:18:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=31c78b6eb965200ad177aed7b8d31f74559fab8c'/>
<id>31c78b6eb965200ad177aed7b8d31f74559fab8c</id>
<content type='text'>
This makes it easier if I want to debug things.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This makes it easier if I want to debug things.
</pre>
</div>
</content>
</entry>
<entry>
<title>grammar/label: `set_end_option`</title>
<updated>2023-07-21T03:40:15+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-07-21T03:40:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=f257f471f49bf13adf56868d8f8609309c7e100b'/>
<id>f257f471f49bf13adf56868d8f8609309c7e100b</id>
<content type='text'>
* grammar/src/label.rs (set_end_option): This function replaces the
  old function `open_end`, as this new function is more general than
  the old one, and there is no specific situation where we only need
  to open the end of a node without the need to close the node in an
  `if` statement.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* grammar/src/label.rs (set_end_option): This function replaces the
  old function `open_end`, as this new function is more general than
  the old one, and there is no specific situation where we only need
  to open the end of a node without the need to close the node in an
  `if` statement.
</pre>
</div>
</content>
</entry>
<entry>
<title>grammar/abnf: Fix a bug of repeatedly adding non-terminals</title>
<updated>2023-07-19T05:45:40+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-07-19T05:45:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=a9ce21b2ff3de3e063361e17961384ba0fe9d975'/>
<id>a9ce21b2ff3de3e063361e17961384ba0fe9d975</id>
<content type='text'>
This bug caused a plain unambiguous grammar to become ambiguous.

Funnily enough, this bug revealed a lot of bugs in the code for
handling forests.  I guess this is an unexpected surprise.  :D
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This bug caused a plain unambiguous grammar to become ambiguous.

Funnily enough, this bug revealed a lot of bugs in the code for
handling forests.  I guess this is an unexpected surprise.  :D
</pre>
</div>
</content>
</entry>
<entry>
<title>Finished the Emacs binding.</title>
<updated>2023-07-08T04:31:13+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-07-08T04:30:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=9a317e56f8a6126583f7d0c431bf878d9b1fe7b1'/>
<id>9a317e56f8a6126583f7d0c431bf878d9b1fe7b1</id>
<content type='text'>
Now the binding part is finished.

What remains is a bug encountered when planting a fragment to the
forest which intersects a packed node, which would lead to invalid
forests.  This will also cause problem when planting a packed
fragment, but until now my testing grammars do not produce packed
fragments, so this problem is not encountered yet.

I am still figuring out efficient ways to solve this problem.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now the binding part is finished.

What remains is a bug encountered when planting a fragment to the
forest which intersects a packed node, which would lead to invalid
forests.  This will also cause problem when planting a packed
fragment, but until now my testing grammars do not produce packed
fragments, so this problem is not encountered yet.

I am still figuring out efficient ways to solve this problem.
</pre>
</div>
</content>
</entry>
<entry>
<title>fixed the bugs of node duplications and left-open nodes</title>
<updated>2023-06-18T07:03:34+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-06-18T07:03:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=a80db17473ff09cc72acba2c1975101e6dbedf39'/>
<id>a80db17473ff09cc72acba2c1975101e6dbedf39</id>
<content type='text'>
There were two main issues in the previous version.

One is that there are lots of duplications of nodes when manipulating
the forest.  This does not mean that labels repeat: by the use of the
data type this cannot happen.  What happened is that there were cloned
nodes whose children are exactly equal.  In this case there is no need
to clone that node in the first place.  This is now fixed by checking
carefully before cloning, so that we do not clone unnecessary nodes.

The other issue, which is perhaps more important, is that there are
nodes which are not closed.  This means that when there should be a
reuction of grammar rules, the forest does not mark the corresponding
node as already reduced.  The incorrect forests thus caused is hard to
fix: I tried several different approaches to fix it afterwards, but
all to no avail.  I also tried to record enough information to fix
these nodes during the manipulations.  It turned out that recording
nodes is a dead end, as I cannot properly syncronize the information
in the forest and the information in the chain-rule machine.  Any
inconsistencies will result in incorrect operations later on.

The approach I finally adapt is to perform every possible reduction at
each step.  This might lead to some more nodes than what we need.  But
those are technically expected to be there after all, and it is easy
to filter them out, so it is fine, from my point of view at the
moment.

Therefore, what remains is to filter those nodes out and connect it to
the holy Emacs.  :D
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
There were two main issues in the previous version.

One is that there are lots of duplications of nodes when manipulating
the forest.  This does not mean that labels repeat: by the use of the
data type this cannot happen.  What happened is that there were cloned
nodes whose children are exactly equal.  In this case there is no need
to clone that node in the first place.  This is now fixed by checking
carefully before cloning, so that we do not clone unnecessary nodes.

The other issue, which is perhaps more important, is that there are
nodes which are not closed.  This means that when there should be a
reuction of grammar rules, the forest does not mark the corresponding
node as already reduced.  The incorrect forests thus caused is hard to
fix: I tried several different approaches to fix it afterwards, but
all to no avail.  I also tried to record enough information to fix
these nodes during the manipulations.  It turned out that recording
nodes is a dead end, as I cannot properly syncronize the information
in the forest and the information in the chain-rule machine.  Any
inconsistencies will result in incorrect operations later on.

The approach I finally adapt is to perform every possible reduction at
each step.  This might lead to some more nodes than what we need.  But
those are technically expected to be there after all, and it is easy
to filter them out, so it is fine, from my point of view at the
moment.

Therefore, what remains is to filter those nodes out and connect it to
the holy Emacs.  :D
</pre>
</div>
</content>
</entry>
<entry>
<title>review of previous bug fix</title>
<updated>2023-06-02T14:44:01+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-06-02T14:43:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=6ce44bb3bdb79e8e727ee6fc7f5c6cd7fa0bb51e'/>
<id>6ce44bb3bdb79e8e727ee6fc7f5c6cd7fa0bb51e</id>
<content type='text'>
Generally speaking the algorithm now works correctly and produces the
right shape of forest for the test ambiguous grammar as well.  It does
not correctly perform the "reductions".  It seems that I deliberately
disabled this part of the functionalities in a previous debugging
tour.

So I have to enable it again and see if it works.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Generally speaking the algorithm now works correctly and produces the
right shape of forest for the test ambiguous grammar as well.  It does
not correctly perform the "reductions".  It seems that I deliberately
disabled this part of the functionalities in a previous debugging
tour.

So I have to enable it again and see if it works.
</pre>
</div>
</content>
</entry>
<entry>
<title>abnf: a skeleton for an ABNF parser</title>
<updated>2023-06-02T07:01:12+00:00</updated>
<author>
<name>JSDurand</name>
<email>mmemmew@gmail.com</email>
</author>
<published>2023-06-02T07:01:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.jsdurand.xyz/rep.git/commit/?id=a6e9f5172fa72094d5c7c2fadf29ffd8cc272687'/>
<id>a6e9f5172fa72094d5c7c2fadf29ffd8cc272687</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
