Commit 1bc8de18 authored by Jesse McGrew's avatar Jesse McGrew
Browse files

Change OldParserWord.Merge to overwrite old part-of-speech values if applicable.

This fixes an issue where two words that were both used as prepositions couldn't
be made synonymous. [ZILF-230]

This touches an arcane part of the compiler and needs more thorough testing.
parent a4bc63c98d6e
......@@ -492,22 +492,40 @@ namespace Zilf.ZModel.Vocab.OldParser
public void Merge(Context ctx, OldParserWord other)
{
if ((other.PartOfSpeech & PartOfSpeech.Adjective) != 0)
{
UnsetPartOfSpeech(ctx, PartOfSpeech.Adjective);
SetAdjective(ctx, other.GetDefinition(PartOfSpeech.Adjective), other.GetValue(PartOfSpeech.Adjective));
}
if ((other.PartOfSpeech & PartOfSpeech.Buzzword) != 0)
{
UnsetPartOfSpeech(ctx, PartOfSpeech.Buzzword);
SetBuzzword(ctx, other.GetDefinition(PartOfSpeech.Buzzword), other.GetValue(PartOfSpeech.Buzzword));
}
if ((other.PartOfSpeech & PartOfSpeech.Direction) != 0)
{
UnsetPartOfSpeech(ctx, PartOfSpeech.Direction);
SetDirection(ctx, other.GetDefinition(PartOfSpeech.Direction), other.GetValue(PartOfSpeech.Direction));
}
if ((other.PartOfSpeech & PartOfSpeech.Object) != 0)
{
UnsetPartOfSpeech(ctx, PartOfSpeech.Object);
SetObject(other.GetDefinition(PartOfSpeech.Object));
}
if ((other.PartOfSpeech & PartOfSpeech.Preposition) != 0)
{
UnsetPartOfSpeech(ctx, PartOfSpeech.Preposition);
SetPreposition(ctx, other.GetDefinition(PartOfSpeech.Preposition), other.GetValue(PartOfSpeech.Preposition));
}
if ((other.PartOfSpeech & PartOfSpeech.Verb) != 0)
{
UnsetPartOfSpeech(ctx, PartOfSpeech.Verb);
SetVerb(ctx, other.GetDefinition(PartOfSpeech.Verb), other.GetValue(PartOfSpeech.Verb));
}
MarkAsSynonym(other.PartOfSpeech & ~PartOfSpeech.FirstMask);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment