diff --git a/Directory.Build.props b/Directory.Build.props index 036216b..bbb92bd 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,8 +15,8 @@ $(MSBuildThisFileDirectory) - $(SolutionDir)build/bin/plugin - $(SolutionDir)build/bin/patcher + $(SolutionDir)build/bin/plugin/$(Configuration) + $(SolutionDir)build/bin/patcher/$(Configuration) $(PluginBinPath)/$(MSBuildProjectName) $(SolutionDir)build/obj/plugin/$(MSBuildProjectName) $(MSBuildProjectName) diff --git a/PatchManager.sln b/PatchManager.sln index 1e06dac..365a497 100644 --- a/PatchManager.sln +++ b/PatchManager.sln @@ -24,6 +24,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Planets", "src EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Science", "src\PatchManager.Science\PatchManager.Science.csproj", "{E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PatchManager.Missions", "src\PatchManager.Missions\PatchManager.Missions.csproj", "{67F415B1-5651-4426-8D4C-F607CA31A338}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -128,5 +130,13 @@ Global {E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.Deploy|Any CPU.Build.0 = Deploy|Any CPU {E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU {E6AD9C2A-D53E-47DD-B48F-7A9AF6ACDC55}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.Release|Any CPU.Build.0 = Release|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.Deploy|Any CPU.ActiveCfg = Deploy|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.Deploy|Any CPU.Build.0 = Deploy|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.DeployAndRun|Any CPU.ActiveCfg = DeployAndRun|Any CPU + {67F415B1-5651-4426-8D4C-F607CA31A338}.DeployAndRun|Any CPU.Build.0 = DeployAndRun|Any CPU EndGlobalSection EndGlobal diff --git a/plugin_template/swinfo.json b/plugin_template/swinfo.json index 5432301..1fd4a77 100644 --- a/plugin_template/swinfo.json +++ b/plugin_template/swinfo.json @@ -5,7 +5,7 @@ "name": "Patch Manager", "description": "A mod for generic patching needs similar to KSP 1's Module Manager.", "source": "https://github.com/KSP2Community/PatchManager", - "version": "0.5.0", + "version": "0.6.0", "version_check": "https://raw.githubusercontent.com/KSP2Community/PatchManager/main/plugin_template/swinfo.json", "ksp2_version": { "min": "0.1.5", diff --git a/src/PatchManager.Core/PatchManager.Core.csproj b/src/PatchManager.Core/PatchManager.Core.csproj index 25f3fce..f7cac82 100644 --- a/src/PatchManager.Core/PatchManager.Core.csproj +++ b/src/PatchManager.Core/PatchManager.Core.csproj @@ -3,7 +3,7 @@ - + diff --git a/src/PatchManager.Missions/Builtins/MissionsBuiltins.cs b/src/PatchManager.Missions/Builtins/MissionsBuiltins.cs new file mode 100644 index 0000000..fc20d7d --- /dev/null +++ b/src/PatchManager.Missions/Builtins/MissionsBuiltins.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using PatchManager.SassyPatching.Attributes; + +namespace PatchManager.Missions.Builtins; + +[SassyLibrary("builtin","missions")] +[UsedImplicitly] +public class MissionsBuiltins +{ + + [SassyMethod("get-property-watcher"), UsedImplicitly] + public static string GetPropertyWatcher([SassyName("property-watcher-name")] string propertyWatcherName) => + MissionsTypes.PropertyWatchers[propertyWatcherName].AssemblyQualifiedName!; + + [SassyMethod("get-message"), UsedImplicitly] + public static string GetMessage([SassyName("message-name")] string messageName) => + MissionsTypes.Messages[messageName].AssemblyQualifiedName!; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/MissionsModule.cs b/src/PatchManager.Missions/MissionsModule.cs new file mode 100644 index 0000000..b373383 --- /dev/null +++ b/src/PatchManager.Missions/MissionsModule.cs @@ -0,0 +1,9 @@ +using JetBrains.Annotations; +using PatchManager.Shared.Modules; + +namespace PatchManager.Missions; + +[UsedImplicitly] +public class MissionsModule : BaseModule +{ +} \ No newline at end of file diff --git a/src/PatchManager.Missions/MissionsTypes.cs b/src/PatchManager.Missions/MissionsTypes.cs new file mode 100644 index 0000000..06e3c3c --- /dev/null +++ b/src/PatchManager.Missions/MissionsTypes.cs @@ -0,0 +1,39 @@ +using KSP.Game.Missions; +using KSP.Messages; +using KSP.Messages.PropertyWatchers; + +namespace PatchManager.Missions; + +public static class MissionsTypes +{ + public static Dictionary Conditions = new(); + public static Dictionary Actions = new(); + public static Dictionary Messages = new(); + public static Dictionary PropertyWatchers = new(); + + static MissionsTypes() + { + foreach (var type in AppDomain.CurrentDomain.GetAssemblies().SelectMany(x => x.GetTypes()).Where(t => !t.IsAbstract)) + { + if (type.IsSubclassOf(typeof(Condition))) + { + Conditions.Add(type.Name,type); + } + + if (typeof(IMissionAction).IsAssignableFrom(type)) + { + Actions.Add(type.Name, type); + } + + if (type.IsSubclassOf(typeof(MessageCenterMessage))) + { + Messages.Add(type.Name, type); + } + + if (type.IsSubclassOf(typeof(PropertyWatcher))) + { + PropertyWatchers.Add(type.Name, type); + } + } + } +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Modifiables/MissionModifiable.cs b/src/PatchManager.Missions/Modifiables/MissionModifiable.cs new file mode 100644 index 0000000..dd988e2 --- /dev/null +++ b/src/PatchManager.Missions/Modifiables/MissionModifiable.cs @@ -0,0 +1,24 @@ +using PatchManager.Missions.Selectables; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Modifiables; + +namespace PatchManager.Missions.Modifiables; + +public class MissionModifiable : JTokenModifiable +{ + private MissionSelectable _missionSelectable; + + public MissionModifiable(MissionSelectable selectable) : base(selectable.MissionObject, selectable.SetModified) + { + _missionSelectable = selectable; + } + + public override void Set(DataValue dataValue) + { + if (dataValue.IsDeletion) + { + _missionSelectable.SetDeleted(); + } + base.Set(dataValue); + } +} \ No newline at end of file diff --git a/src/PatchManager.Missions/PatchManager.Missions.csproj b/src/PatchManager.Missions/PatchManager.Missions.csproj new file mode 100644 index 0000000..2a1b7c7 --- /dev/null +++ b/src/PatchManager.Missions/PatchManager.Missions.csproj @@ -0,0 +1,17 @@ + + + + enable + enable + + + + + + + + + + + + diff --git a/src/PatchManager.Missions/Rulesets/MissionRuleset.cs b/src/PatchManager.Missions/Rulesets/MissionRuleset.cs new file mode 100644 index 0000000..b3028bf --- /dev/null +++ b/src/PatchManager.Missions/Rulesets/MissionRuleset.cs @@ -0,0 +1,29 @@ +using KSP.Game.Missions.Definitions; +using Newtonsoft.Json.Linq; +using PatchManager.Missions.Selectables; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Attributes; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.NewAssets; + +namespace PatchManager.Missions.Rulesets; + +[PatcherRuleset("missions","missions")] +public class MissionRuleset : IPatcherRuleSet +{ + public bool Matches(string label) => label == "missions"; + + public ISelectable ConvertToSelectable(string type, string name, string jsonData) => + new MissionSelectable(JObject.Parse(jsonData)); + + public INewAsset CreateNew(List dataValues) + { + var missionDataObject = new MissionData + { + ID = dataValues[0].String + }; + + return new NewGenericAsset("missions", dataValues[0].String, + new MissionSelectable(JObject.FromObject(missionDataObject))); + } +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/ActionsSelectable.cs b/src/PatchManager.Missions/Selectables/ActionsSelectable.cs new file mode 100644 index 0000000..fcb45e9 --- /dev/null +++ b/src/PatchManager.Missions/Selectables/ActionsSelectable.cs @@ -0,0 +1,93 @@ +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Modifiables; +using PatchManager.SassyPatching.Selectables; + +namespace PatchManager.Missions.Selectables; + +public sealed class ActionsSelectable : BaseSelectable +{ + public MissionSelectable Selectable; + public JArray Actions; + + private static string TrimTypeName(string typeName) + { + var comma = typeName.IndexOf(','); + if (comma != -1) + { + typeName = typeName[..comma]; + } + + var period = typeName.LastIndexOf('.'); + if (period != -1) + { + typeName = typeName[(period + 1)..]; + } + + return typeName; + } + + public ActionsSelectable(MissionSelectable selectable, JArray actions) + { + Selectable = selectable; + Actions = actions; + Children = new(); + Classes = new(); + foreach (var action in actions) + { + var obj = (JObject)action; + var type = obj["$type"]!.Value()!; + var trimmedType = TrimTypeName(type); + Classes.Add(trimmedType); + Children.Add(new JTokenSelectable(Selectable.SetModified,obj,token => TrimTypeName(((JObject)token)!.Value()!),trimmedType)); + } + } + public override List Children { get; } + public override string Name => "actions"; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + foreach (var action in Actions) + { + var obj = (JObject)action; + var type = obj["$type"]!.Value()!; + var trimmedType = TrimTypeName(type); + if (trimmedType != @class) continue; + classValue = DataValue.FromJToken(action); + return true; + } + classValue = DataValue.Null; + return false; + } + + public override bool IsSameAs(ISelectable other) => + other is ActionsSelectable actionsSelectable && actionsSelectable.Actions == Actions; + + public override IModifiable OpenModification() => new JTokenModifiable(Actions, Selectable.SetModified); + + public override ISelectable AddElement(string elementType) + { + var actualType = MissionsTypes.Actions[elementType]; + var elementObject = new JObject() + { + ["$type"] = actualType.AssemblyQualifiedName + }; + foreach (var (key, value) in JObject.FromObject(Activator.CreateInstance(actualType))) + { + elementObject[key] = value; + } + var selectable = new JTokenSelectable(Selectable.SetModified, elementObject, token => TrimTypeName(((JObject)token)!.Value()!), elementType); + Children.Add(selectable); + Classes.Add(elementType); + Actions.Add(elementObject); + return selectable; + } + + public override string Serialize() => Actions.ToString(); + + public override DataValue GetValue() => DataValue.FromJToken(Actions); + + public override string ElementType => "actions"; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/ConditionSetSelectable.cs b/src/PatchManager.Missions/Selectables/ConditionSetSelectable.cs new file mode 100644 index 0000000..4db5deb --- /dev/null +++ b/src/PatchManager.Missions/Selectables/ConditionSetSelectable.cs @@ -0,0 +1,97 @@ +using KSP.Game.Missions; +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Modifiables; +using PatchManager.SassyPatching.Selectables; + +namespace PatchManager.Missions.Selectables; + +public sealed class ConditionSetSelectable : BaseSelectable +{ + public MissionSelectable MissionSelectable; + public JObject ConditionSet; + private JArray _children; + public ConditionSetSelectable(MissionSelectable missionSelectable, JObject conditionSet) + { + MissionSelectable = missionSelectable; + ConditionSet = conditionSet; + _children = (JArray)conditionSet["Children"]!; + Children = new(); + Classes = new(); + Classes.Add("ConditionType"); + Classes.Add("ConditionMode"); + // We aren't going to add the condition type as a child, it will still be editable tho + foreach (var child in _children) + { + var condition = (JObject)child; + var type = condition["ConditionType"]!.Value()!; + Classes.Add(type); + if (type == "ConditionSet") + { + Children.Add(new ConditionSetSelectable(missionSelectable,condition)); + } + else + { + Children.Add(new JTokenSelectable(MissionSelectable.SetModified, condition, + token => ((JObject)token)["ConditionType"]!.Value()!, type)); + } + } + } + + public override List Children { get; } + public override string Name => "ConditionSet"; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + foreach (var child in _children) + { + var condition = (JObject)child; + var type = condition["ConditionType"]!.Value()!; + if (type != @class) + continue; + classValue = DataValue.FromJToken(child); + } + classValue = DataValue.Null; + return false; + } + + public override bool IsSameAs(ISelectable other) => other is ConditionSetSelectable conditionSetSelectable && + conditionSetSelectable.ConditionSet == ConditionSet; + + public override IModifiable OpenModification() => new JTokenModifiable(ConditionSet, MissionSelectable.SetModified); + + public override ISelectable AddElement(string elementType) + { + var conditionType = MissionsTypes.Conditions[elementType]; + var conditionObject = new JObject() + { + ["$type"] = conditionType.AssemblyQualifiedName + }; + foreach (var (key, value) in JObject.FromObject(Activator.CreateInstance(conditionType))) + { + conditionObject[key] = value; + } + _children.Add(conditionObject); + if (conditionType == typeof(ConditionSet)) + { + var selectable = new ConditionSetSelectable(MissionSelectable, conditionObject); + Children.Add(selectable); + return selectable; + } + else + { + var selectable = new JTokenSelectable(MissionSelectable.SetModified, conditionObject, + "scriptableCondition", "scriptableCondition"); + Children.Add(selectable); + return selectable; + } + } + + public override string Serialize() => ConditionSet.ToString(); + + public override DataValue GetValue() => DataValue.FromJToken(ConditionSet); + + public override string ElementType => "ConditionSet"; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/ContentBranchSelectable.cs b/src/PatchManager.Missions/Selectables/ContentBranchSelectable.cs new file mode 100644 index 0000000..fdfcc16 --- /dev/null +++ b/src/PatchManager.Missions/Selectables/ContentBranchSelectable.cs @@ -0,0 +1,51 @@ +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Modifiables; + +namespace PatchManager.Missions.Selectables; + +public sealed class ContentBranchSelectable : BaseSelectable +{ + public MissionSelectable Selectable; + public JObject ContentBranch; + private ActionsSelectable _actionsSelectable; + public ContentBranchSelectable(MissionSelectable selectable, JObject contentBranch) + { + Selectable = selectable; + ContentBranch = contentBranch; + Classes = new(); + Classes.Add("actions"); + Children = new(); + _actionsSelectable = new ActionsSelectable(selectable, (JArray)contentBranch["actions"]!); + Children.Add(_actionsSelectable); + Classes.AddRange(_actionsSelectable.Classes); + Children.AddRange(_actionsSelectable.Children); + } + + public override List Children { get; } + public override string Name => ContentBranch["ID"]!.Value()!; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) => + _actionsSelectable.MatchesClass(@class, out classValue); + + public override bool IsSameAs(ISelectable other) => other is ContentBranchSelectable contentBranchSelectable && + contentBranchSelectable.ContentBranch == ContentBranch; + + public override IModifiable OpenModification() => new JTokenModifiable(ContentBranch, Selectable.SetModified); + + public override ISelectable AddElement(string elementType) + { + var result = _actionsSelectable.AddElement(elementType); + Children.Add(result); + Classes.Add(elementType); + return result; + } + + public override string Serialize() => ContentBranch.ToString(); + + public override DataValue GetValue() => DataValue.FromJToken(ContentBranch); + + public override string ElementType => ContentBranch["ID"]!.Value()!; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/ContentBranchesSelectable.cs b/src/PatchManager.Missions/Selectables/ContentBranchesSelectable.cs new file mode 100644 index 0000000..cac2c3f --- /dev/null +++ b/src/PatchManager.Missions/Selectables/ContentBranchesSelectable.cs @@ -0,0 +1,73 @@ +using KSP.Game.Missions; +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Modifiables; + +namespace PatchManager.Missions.Selectables; + +public sealed class ContentBranchesSelectable : BaseSelectable +{ + public MissionSelectable Selectable; + public JArray ContentBranches; + public ContentBranchesSelectable(MissionSelectable selectable, JArray contentBranches) + { + Selectable = selectable; + ContentBranches = contentBranches; + Children = new(); + Classes = new(); + foreach (var child in ContentBranches) + { + var obj = (JObject)child; + var id = obj["ID"]!.Value()!; + Classes.Add(id); + Children.Add(new ContentBranchSelectable(selectable,obj)); + } + } + + + public override List Children { get; } + public override string Name => "ContentBranches"; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + foreach (var child in ContentBranches) + { + var obj = (JObject)child; + var id = obj["ID"]!.Value()!; + if (id != @class) + continue; + classValue = DataValue.FromJToken(obj); + return true; + } + + classValue = DataValue.Null; + return false; + } + + public override bool IsSameAs(ISelectable other) => other is ContentBranchesSelectable contentBranchesSelectable && + contentBranchesSelectable.ContentBranches == ContentBranches; + + public override IModifiable OpenModification() => new JTokenModifiable(ContentBranches, Selectable.SetModified); + + public override ISelectable AddElement(string elementType) + { + var branch = new MissionContentBranch + { + ID = elementType + }; + var obj = JObject.FromObject(branch); + var selectable = new ContentBranchSelectable(Selectable, obj); + Children.Add(selectable); + Classes.Add(elementType); + ContentBranches.Add(obj); + return selectable; + } + + public override string Serialize() => ContentBranches.ToString(); + + public override DataValue GetValue() => DataValue.FromJToken(ContentBranches); + + public override string ElementType => "ContentBranches"; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/MissionRewardSelectable.cs b/src/PatchManager.Missions/Selectables/MissionRewardSelectable.cs new file mode 100644 index 0000000..462dec0 --- /dev/null +++ b/src/PatchManager.Missions/Selectables/MissionRewardSelectable.cs @@ -0,0 +1,76 @@ +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Modifiables; +using PatchManager.SassyPatching.Selectables; + +namespace PatchManager.Missions.Selectables; + +public sealed class MissionRewardSelectable : BaseSelectable +{ + public MissionSelectable MissionSelectable; + public JObject MissionReward; + private JArray _missionRewardDefinitions; + public MissionRewardSelectable(MissionSelectable missionSelectable, JObject missionReward) + { + MissionSelectable = missionSelectable; + MissionReward = missionReward; + _missionRewardDefinitions = (JArray)missionReward["MissionRewardDefinitions"]!; + Classes = new(); + Children = new(); + foreach (var child in _missionRewardDefinitions) + { + var obj = (JObject)child; + var name = obj["MissionRewardType"]!.Value()!; + Classes.Add(name); + Children.Add(new JTokenSelectable(MissionSelectable.SetModified,child, token => ((JObject)token)["MissionRewardType"]!.Value(),name)); + } + } + public override List Children { get; } + public override string Name => "MissionReward"; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + foreach (var child in _missionRewardDefinitions) + { + var obj = (JObject)child; + var name = obj["MissionRewardType"]!.Value()!; + if (name != @class) + { + continue; + } + + classValue = DataValue.FromJToken(obj); + return true; + } + classValue = DataValue.Null; + return false; + } + + public override bool IsSameAs(ISelectable other) => other is MissionRewardSelectable missionRewardSelectable && + missionRewardSelectable.MissionReward == MissionReward; + + public override IModifiable OpenModification() => + new JTokenModifiable(MissionReward, MissionSelectable.SetModified); + + public override ISelectable AddElement(string elementType) + { + var obj = new JObject + { + ["MissionRewardType"] = elementType + }; + Classes.Add(elementType); + var selectable = new JTokenSelectable(MissionSelectable.SetModified, obj, + token => ((JObject)token)["MissionRewardType"]!.Value(), elementType); + Children.Add(selectable); + _missionRewardDefinitions.Add(obj); + return selectable; + } + + public override string Serialize() => MissionReward.ToString(); + + public override DataValue GetValue() => DataValue.From(_missionRewardDefinitions); + + public override string ElementType => "MissionReward"; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/MissionSelectable.cs b/src/PatchManager.Missions/Selectables/MissionSelectable.cs new file mode 100644 index 0000000..29b4628 --- /dev/null +++ b/src/PatchManager.Missions/Selectables/MissionSelectable.cs @@ -0,0 +1,86 @@ +using JetBrains.Annotations; +using Newtonsoft.Json.Linq; +using PatchManager.Missions.Modifiables; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Selectables; + +namespace PatchManager.Missions.Selectables; + +public sealed class MissionSelectable : BaseSelectable +{ + private bool _modified = false; + private bool _deleted = false; + + + /// + /// Marks this part selectable as having been modified any level down + /// + public void SetModified() + { + _modified = true; + } + + /// + /// Marks this part as goneso + /// + public void SetDeleted() + { + SetModified(); + _deleted = true; + } + + public MissionSelectable(JObject missionObject) + { + MissionObject = missionObject; + Children = new(); + Classes = new(); + foreach (var child in missionObject) + { + Classes.Add(child.Key); + if (child.Key != "missionStages" && child.Key != "ContentBranches") + { + Children.Add(new JTokenSelectable(SetModified, child.Value, child.Key, child.Key)); + } + } + + var stages = (JArray)MissionObject["missionStages"]!; + Children.Add(new StagesSelectable(this, stages)); + if (missionObject.ContainsKey("ContentBranches")) + { + var branches = (JArray)MissionObject["ContentBranches"]!; + Children.Add(new ContentBranchesSelectable(this, branches)); + } + } + + public JObject MissionObject; + + public override List Children { get; } + public override string Name => MissionObject["ID"]!.Value()!; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + if (MissionObject.TryGetValue(@class, out var jToken)) + { + classValue = DataValue.FromJToken(jToken); + return true; + } + classValue = DataValue.Null; + return false; + } + + public override bool IsSameAs(ISelectable other) => + other is MissionSelectable selectable && selectable.MissionObject == MissionObject; + + public override IModifiable OpenModification() => new MissionModifiable(this); + + public override ISelectable AddElement(string elementType) => throw new Exception( + "You cannot add elements to the main body of the mission, try using ContentBranches, or missionStages for that"); + + public override string Serialize() => _deleted ? "" : MissionObject.ToString(); + + public override DataValue GetValue() => DataValue.FromJToken(MissionObject); + + public override string ElementType => "missions"; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/StageSelectable.cs b/src/PatchManager.Missions/Selectables/StageSelectable.cs new file mode 100644 index 0000000..25a4ad1 --- /dev/null +++ b/src/PatchManager.Missions/Selectables/StageSelectable.cs @@ -0,0 +1,124 @@ +using KSP.Game.Missions; +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Modifiables; +using PatchManager.SassyPatching.Selectables; + +namespace PatchManager.Missions.Selectables; + +public sealed class StageSelectable : BaseSelectable +{ + public MissionSelectable MissionSelectable; + + public JObject StageObject; + + private int ConditionIndex = -1; + + public StageSelectable(MissionSelectable missionSelectable, JObject stageObject) + { + MissionSelectable = missionSelectable; + StageObject = stageObject; + Children = new(); + Classes = new(); + foreach (var child in stageObject) + { + Classes.Add(child.Key); + if (child.Key != "scriptableCondition" && child.Key != "actions" && child.Key != "MissionReward") + { + Children.Add(new JTokenSelectable(MissionSelectable.SetModified, child.Value, child.Key, child.Key)); + } + } + + if (stageObject["scriptableCondition"].Type == JTokenType.Object) + { + if (((JObject)stageObject["scriptableCondition"]!)["ConditionType"]!.Value() == "ConditionSet") + { + + ConditionIndex = Children.Count; + Children.Add( + new ConditionSetSelectable(missionSelectable, (JObject)stageObject["scriptableCondition"]!)); + } + else + { + + ConditionIndex = Children.Count; + Children.Add(new JTokenSelectable(MissionSelectable.SetModified, stageObject["scriptableCondition"], + "scriptableCondition", "scriptableCondition")); + } + } + + if (stageObject.TryGetValue("MissionReward", out var value)) + { + Children.Add(new MissionRewardSelectable(MissionSelectable, (JObject)value!)); + } + + Children.Add(new ActionsSelectable(MissionSelectable,(JArray)stageObject["actions"]!)); + } + + public override List Children { get; } + public override string Name => $"_{StageObject["StageID"]!.Value()}"; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + if (StageObject.TryGetValue(@class, out var jToken)) + { + classValue = DataValue.FromJToken(jToken); + return true; + } + classValue = DataValue.Null; + return false; + } + + public override bool IsSameAs(ISelectable other) => + other is StageSelectable stageSelectable && stageSelectable.StageObject == StageObject; + + public override IModifiable OpenModification() => new JTokenModifiable(StageObject,MissionSelectable.SetModified); + + public override ISelectable AddElement(string elementType) + { + var conditionType = MissionsTypes.Conditions[elementType]; + // var conditionObject = JObject.FromObject(Activator.CreateInstance(conditionType)); + var conditionObject = new JObject(); + foreach (var (key, value) in JObject.FromObject(Activator.CreateInstance(conditionType))) + { + conditionObject[key] = value; + } + StageObject["scriptableCondition"] = conditionObject; + if (conditionType == typeof(ConditionSet)) + { + var selectable = new ConditionSetSelectable(MissionSelectable, conditionObject); + if (ConditionIndex > 0) + { + return Children[ConditionIndex] = selectable; + } + + ConditionIndex = Children.Count; + Children.Add(selectable); + return selectable; + } + else + { + + var selectable = new JTokenSelectable(MissionSelectable.SetModified, conditionObject, + "scriptableCondition", "scriptableCondition"); + + if (ConditionIndex > 0) + { + return Children[ConditionIndex] = selectable; + } + + ConditionIndex = Children.Count; + Children.Add(selectable); + return selectable; + } + + } + + public override string Serialize() => StageObject.ToString(); + + public override DataValue GetValue() => DataValue.From(StageObject); + + public override string ElementType => $"_{StageObject["StageID"]!.Value()}"; +} \ No newline at end of file diff --git a/src/PatchManager.Missions/Selectables/StagesSelectable.cs b/src/PatchManager.Missions/Selectables/StagesSelectable.cs new file mode 100644 index 0000000..985c02f --- /dev/null +++ b/src/PatchManager.Missions/Selectables/StagesSelectable.cs @@ -0,0 +1,73 @@ +using KSP.Game.Missions.Definitions; +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Modifiables; + +namespace PatchManager.Missions.Selectables; + +public sealed class StagesSelectable : BaseSelectable +{ + public MissionSelectable MissionSelectable; + public JArray Stages; + public StagesSelectable(MissionSelectable selectable, JArray stages) + { + MissionSelectable = selectable; + Stages = stages; + Children = new(); + Classes = new(); + foreach (var stage in stages) + { + var obj = (JObject)stage; + var id = obj["StageID"]!.Value(); + var idString = $"_{id}"; + Classes.Add(idString); + Children.Add(new StageSelectable(selectable, obj)); + } + } + + public override List Children { get; } + public override string Name => "missionStages"; + public override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + var num = long.Parse(@class[1..]); + foreach (var stage in Stages) + { + var obj = (JObject)stage; + var id = obj["ID"]!.Value(); + if (id != num) continue; + classValue = DataValue.FromJToken(obj); + return true; + } + classValue = DataValue.Null; + return false; + } + + public override bool IsSameAs(ISelectable other) => + other is StagesSelectable stagesSelectable && stagesSelectable.Stages == Stages; + + public override IModifiable OpenModification() => new JTokenModifiable(Stages, MissionSelectable.SetModified); + + public override ISelectable AddElement(string elementType) + { + var num = long.Parse(elementType[1..]); + var obj = new MissionStage + { + StageID = (int)num + }; + var stage = JObject.FromObject(obj); + Classes.Add(elementType); + var selectable = new StageSelectable(MissionSelectable, stage); + Children.Add(selectable); + Stages.Add(stage); + return selectable; + } + + public override string Serialize() => Stages.ToString(); + + public override DataValue GetValue() => DataValue.FromJToken(Stages); + + public override string ElementType => "missionStages"; +} \ No newline at end of file diff --git a/src/PatchManager.Parts/PatchManager.Parts.csproj b/src/PatchManager.Parts/PatchManager.Parts.csproj index ff5e352..e973893 100644 --- a/src/PatchManager.Parts/PatchManager.Parts.csproj +++ b/src/PatchManager.Parts/PatchManager.Parts.csproj @@ -6,7 +6,11 @@ - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/src/PatchManager.Planets/PatchManager.Planets.csproj b/src/PatchManager.Planets/PatchManager.Planets.csproj index b740c4a..c0e3d53 100644 --- a/src/PatchManager.Planets/PatchManager.Planets.csproj +++ b/src/PatchManager.Planets/PatchManager.Planets.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/PatchManager.SassyPatching/Execution/SassyTextPatcher.cs b/src/PatchManager.SassyPatching/Execution/SassyTextPatcher.cs index 54abfda..19894c0 100644 --- a/src/PatchManager.SassyPatching/Execution/SassyTextPatcher.cs +++ b/src/PatchManager.SassyPatching/Execution/SassyTextPatcher.cs @@ -42,6 +42,7 @@ internal SassyTextPatcher(Environment environmentSnapshot, SelectionBlock rootSe // Priority = global.Universe.AllStages[stageName]; // } var global = environmentSnapshot.GlobalEnvironment; + OriginalGuid = environmentSnapshot.GlobalEnvironment.ModGuid; var universe = global.Universe; PriorityString = rootSelectionBlock.Attributes.OfType().FirstOrDefault() is { } runAtStageAttribute @@ -50,8 +51,8 @@ internal SassyTextPatcher(Environment environmentSnapshot, SelectionBlock rootSe } - public string OriginalGuid { get; internal set; } - public string PriorityString { get; internal set; } + public string OriginalGuid { get; } + public string PriorityString { get; } /// public ulong Priority { get; set; } diff --git a/src/PatchManager.SassyPatching/Modifiables/JTokenModifiable.cs b/src/PatchManager.SassyPatching/Modifiables/JTokenModifiable.cs index 5553237..ee5326f 100644 --- a/src/PatchManager.SassyPatching/Modifiables/JTokenModifiable.cs +++ b/src/PatchManager.SassyPatching/Modifiables/JTokenModifiable.cs @@ -132,7 +132,7 @@ public void SetFieldValue(string fieldName, DataValue dataValue) } } - public void Set(DataValue dataValue) + public virtual void Set(DataValue dataValue) { _setDirty(); if (dataValue.IsDeletion) diff --git a/src/PatchManager.SassyPatching/Nodes/Statements/Conditional.cs b/src/PatchManager.SassyPatching/Nodes/Statements/Conditional.cs index 38c96a6..ad2462b 100644 --- a/src/PatchManager.SassyPatching/Nodes/Statements/Conditional.cs +++ b/src/PatchManager.SassyPatching/Nodes/Statements/Conditional.cs @@ -43,7 +43,7 @@ public override void ExecuteIn(Environment environment) } else { - Else.ExecuteIn(environment); + Else?.ExecuteIn(environment); } } diff --git a/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.cs b/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.cs index 1e33bda..7b9c758 100644 --- a/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.cs +++ b/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.cs @@ -130,7 +130,7 @@ static sassy_lexer() { } } private static int[] _serializedATN = { - 4,0,69,629,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, + 4,0,69,627,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7, 6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14, 7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21, 7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28, @@ -172,173 +172,172 @@ static sassy_lexer() { 64,1,64,4,64,547,8,64,11,64,12,64,548,1,65,4,65,552,8,65,11,65,12,65,553, 1,65,1,65,4,65,558,8,65,11,65,12,65,559,1,66,1,66,1,67,1,67,1,68,1,68, 1,68,1,68,3,68,570,8,68,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,1,69,3, - 69,581,8,69,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,71,1,71,1,71,1,71,5,71, - 594,8,71,10,71,12,71,597,9,71,1,72,1,72,1,72,1,72,5,72,603,8,72,10,72, - 12,72,606,9,72,1,73,1,73,1,73,1,74,1,74,1,74,1,75,1,75,1,75,1,76,1,76, - 1,76,1,76,1,76,1,77,1,77,1,77,1,78,1,78,1,78,1,79,1,79,0,0,80,1,1,3,0, - 5,0,7,2,9,3,11,4,13,5,15,6,17,7,19,8,21,9,23,10,25,11,27,12,29,13,31,14, - 33,15,35,16,37,17,39,18,41,19,43,20,45,21,47,22,49,23,51,24,53,25,55,26, - 57,27,59,28,61,29,63,30,65,31,67,32,69,33,71,34,73,35,75,36,77,37,79,38, - 81,39,83,40,85,41,87,42,89,43,91,44,93,45,95,46,97,47,99,48,101,49,103, - 50,105,51,107,52,109,53,111,54,113,55,115,56,117,57,119,58,121,59,123, - 60,125,61,127,62,129,0,131,0,133,0,135,0,137,0,139,0,141,0,143,0,145,0, - 147,63,149,64,151,65,153,66,155,67,157,68,159,69,1,0,16,1,0,42,42,2,0, - 42,42,47,47,2,0,10,10,13,13,3,0,9,10,12,13,32,32,2,0,34,34,92,92,2,0,39, - 39,92,92,1,0,48,57,3,0,48,57,65,70,97,102,8,0,34,34,39,39,92,92,98,98, - 102,102,110,110,114,114,116,116,5,0,42,42,63,63,65,90,95,95,97,122,7,0, - 42,42,46,46,48,57,63,63,65,90,95,95,97,122,1,0,45,45,4,0,42,42,63,63,65, - 90,97,122,3,0,65,90,95,95,97,122,5,0,46,46,48,57,65,90,95,95,97,122,2, - 0,65,90,97,122,645,0,1,1,0,0,0,0,7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0, - 13,1,0,0,0,0,15,1,0,0,0,0,17,1,0,0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1, - 0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0,29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0, - 0,35,1,0,0,0,0,37,1,0,0,0,0,39,1,0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45, - 1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0,0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0, - 0,0,57,1,0,0,0,0,59,1,0,0,0,0,61,1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67, - 1,0,0,0,0,69,1,0,0,0,0,71,1,0,0,0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0, - 0,0,79,1,0,0,0,0,81,1,0,0,0,0,83,1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89, - 1,0,0,0,0,91,1,0,0,0,0,93,1,0,0,0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0, - 0,0,101,1,0,0,0,0,103,1,0,0,0,0,105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0, - 0,0,111,1,0,0,0,0,113,1,0,0,0,0,115,1,0,0,0,0,117,1,0,0,0,0,119,1,0,0, - 0,0,121,1,0,0,0,0,123,1,0,0,0,0,125,1,0,0,0,0,127,1,0,0,0,0,147,1,0,0, - 0,0,149,1,0,0,0,0,151,1,0,0,0,0,153,1,0,0,0,0,155,1,0,0,0,0,157,1,0,0, - 0,0,159,1,0,0,0,1,163,1,0,0,0,3,167,1,0,0,0,5,200,1,0,0,0,7,210,1,0,0, - 0,9,216,1,0,0,0,11,221,1,0,0,0,13,231,1,0,0,0,15,235,1,0,0,0,17,241,1, - 0,0,0,19,250,1,0,0,0,21,257,1,0,0,0,23,264,1,0,0,0,25,269,1,0,0,0,27,274, - 1,0,0,0,29,282,1,0,0,0,31,285,1,0,0,0,33,291,1,0,0,0,35,294,1,0,0,0,37, - 299,1,0,0,0,39,306,1,0,0,0,41,315,1,0,0,0,43,322,1,0,0,0,45,336,1,0,0, - 0,47,345,1,0,0,0,49,353,1,0,0,0,51,360,1,0,0,0,53,365,1,0,0,0,55,373,1, - 0,0,0,57,380,1,0,0,0,59,388,1,0,0,0,61,403,1,0,0,0,63,418,1,0,0,0,65,420, - 1,0,0,0,67,422,1,0,0,0,69,424,1,0,0,0,71,426,1,0,0,0,73,428,1,0,0,0,75, - 430,1,0,0,0,77,432,1,0,0,0,79,434,1,0,0,0,81,436,1,0,0,0,83,438,1,0,0, - 0,85,440,1,0,0,0,87,442,1,0,0,0,89,444,1,0,0,0,91,446,1,0,0,0,93,450,1, - 0,0,0,95,452,1,0,0,0,97,455,1,0,0,0,99,457,1,0,0,0,101,460,1,0,0,0,103, - 463,1,0,0,0,105,466,1,0,0,0,107,470,1,0,0,0,109,473,1,0,0,0,111,476,1, - 0,0,0,113,481,1,0,0,0,115,483,1,0,0,0,117,488,1,0,0,0,119,493,1,0,0,0, - 121,499,1,0,0,0,123,514,1,0,0,0,125,534,1,0,0,0,127,536,1,0,0,0,129,544, - 1,0,0,0,131,551,1,0,0,0,133,561,1,0,0,0,135,563,1,0,0,0,137,569,1,0,0, - 0,139,580,1,0,0,0,141,582,1,0,0,0,143,589,1,0,0,0,145,598,1,0,0,0,147, - 607,1,0,0,0,149,610,1,0,0,0,151,613,1,0,0,0,153,616,1,0,0,0,155,621,1, - 0,0,0,157,624,1,0,0,0,159,627,1,0,0,0,161,164,3,5,2,0,162,164,3,3,1,0, - 163,161,1,0,0,0,163,162,1,0,0,0,164,165,1,0,0,0,165,166,6,0,0,0,166,2, - 1,0,0,0,167,168,5,47,0,0,168,169,5,42,0,0,169,173,1,0,0,0,170,172,8,0, - 0,0,171,170,1,0,0,0,172,175,1,0,0,0,173,171,1,0,0,0,173,174,1,0,0,0,174, - 177,1,0,0,0,175,173,1,0,0,0,176,178,5,42,0,0,177,176,1,0,0,0,178,179,1, - 0,0,0,179,177,1,0,0,0,179,180,1,0,0,0,180,195,1,0,0,0,181,185,8,1,0,0, - 182,184,8,0,0,0,183,182,1,0,0,0,184,187,1,0,0,0,185,183,1,0,0,0,185,186, - 1,0,0,0,186,189,1,0,0,0,187,185,1,0,0,0,188,190,5,42,0,0,189,188,1,0,0, - 0,190,191,1,0,0,0,191,189,1,0,0,0,191,192,1,0,0,0,192,194,1,0,0,0,193, - 181,1,0,0,0,194,197,1,0,0,0,195,193,1,0,0,0,195,196,1,0,0,0,196,198,1, - 0,0,0,197,195,1,0,0,0,198,199,5,47,0,0,199,4,1,0,0,0,200,201,5,47,0,0, - 201,202,5,47,0,0,202,206,1,0,0,0,203,205,8,2,0,0,204,203,1,0,0,0,205,208, - 1,0,0,0,206,204,1,0,0,0,206,207,1,0,0,0,207,6,1,0,0,0,208,206,1,0,0,0, - 209,211,7,3,0,0,210,209,1,0,0,0,211,212,1,0,0,0,212,210,1,0,0,0,212,213, - 1,0,0,0,213,214,1,0,0,0,214,215,6,3,0,0,215,8,1,0,0,0,216,217,5,64,0,0, - 217,218,5,117,0,0,218,219,5,115,0,0,219,220,5,101,0,0,220,10,1,0,0,0,221, - 222,5,64,0,0,222,223,5,102,0,0,223,224,5,117,0,0,224,225,5,110,0,0,225, - 226,5,99,0,0,226,227,5,116,0,0,227,228,5,105,0,0,228,229,5,111,0,0,229, - 230,5,110,0,0,230,12,1,0,0,0,231,232,5,64,0,0,232,233,5,105,0,0,233,234, - 5,102,0,0,234,14,1,0,0,0,235,236,5,64,0,0,236,237,5,101,0,0,237,238,5, - 108,0,0,238,239,5,115,0,0,239,240,5,101,0,0,240,16,1,0,0,0,241,242,5,64, - 0,0,242,243,5,101,0,0,243,244,5,108,0,0,244,245,5,115,0,0,245,246,5,101, - 0,0,246,247,5,45,0,0,247,248,5,105,0,0,248,249,5,102,0,0,249,18,1,0,0, - 0,250,251,5,64,0,0,251,252,5,109,0,0,252,253,5,105,0,0,253,254,5,120,0, - 0,254,255,5,105,0,0,255,256,5,110,0,0,256,20,1,0,0,0,257,258,5,64,0,0, - 258,259,5,119,0,0,259,260,5,104,0,0,260,261,5,105,0,0,261,262,5,108,0, - 0,262,263,5,101,0,0,263,22,1,0,0,0,264,265,5,64,0,0,265,266,5,102,0,0, - 266,267,5,111,0,0,267,268,5,114,0,0,268,24,1,0,0,0,269,270,5,102,0,0,270, - 271,5,114,0,0,271,272,5,111,0,0,272,273,5,109,0,0,273,26,1,0,0,0,274,275, - 5,116,0,0,275,276,5,104,0,0,276,277,5,114,0,0,277,278,5,111,0,0,278,279, - 5,117,0,0,279,280,5,103,0,0,280,281,5,104,0,0,281,28,1,0,0,0,282,283,5, - 116,0,0,283,284,5,111,0,0,284,30,1,0,0,0,285,286,5,64,0,0,286,287,5,101, - 0,0,287,288,5,97,0,0,288,289,5,99,0,0,289,290,5,104,0,0,290,32,1,0,0,0, - 291,292,5,105,0,0,292,293,5,110,0,0,293,34,1,0,0,0,294,295,5,64,0,0,295, - 296,5,115,0,0,296,297,5,101,0,0,297,298,5,116,0,0,298,36,1,0,0,0,299,300, - 5,64,0,0,300,301,5,109,0,0,301,302,5,101,0,0,302,303,5,114,0,0,303,304, - 5,103,0,0,304,305,5,101,0,0,305,38,1,0,0,0,306,307,5,64,0,0,307,308,5, - 114,0,0,308,309,5,101,0,0,309,310,5,113,0,0,310,311,5,117,0,0,311,312, - 5,105,0,0,312,313,5,114,0,0,313,314,5,101,0,0,314,40,1,0,0,0,315,316,5, - 64,0,0,316,317,5,115,0,0,317,318,5,116,0,0,318,319,5,97,0,0,319,320,5, - 103,0,0,320,321,5,101,0,0,321,42,1,0,0,0,322,323,5,64,0,0,323,324,5,100, - 0,0,324,325,5,101,0,0,325,326,5,102,0,0,326,327,5,105,0,0,327,328,5,110, - 0,0,328,329,5,101,0,0,329,330,5,45,0,0,330,331,5,115,0,0,331,332,5,116, - 0,0,332,333,5,97,0,0,333,334,5,103,0,0,334,335,5,101,0,0,335,44,1,0,0, - 0,336,337,5,64,0,0,337,338,5,105,0,0,338,339,5,110,0,0,339,340,5,99,0, - 0,340,341,5,108,0,0,341,342,5,117,0,0,342,343,5,100,0,0,343,344,5,101, - 0,0,344,46,1,0,0,0,345,346,5,64,0,0,346,347,5,114,0,0,347,348,5,101,0, - 0,348,349,5,116,0,0,349,350,5,117,0,0,350,351,5,114,0,0,351,352,5,110, - 0,0,352,48,1,0,0,0,353,354,5,64,0,0,354,355,5,112,0,0,355,356,5,97,0,0, - 356,357,5,116,0,0,357,358,5,99,0,0,358,359,5,104,0,0,359,50,1,0,0,0,360, - 361,5,64,0,0,361,362,5,110,0,0,362,363,5,101,0,0,363,364,5,119,0,0,364, - 52,1,0,0,0,365,366,5,64,0,0,366,367,5,98,0,0,367,368,5,101,0,0,368,369, - 5,102,0,0,369,370,5,111,0,0,370,371,5,114,0,0,371,372,5,101,0,0,372,54, - 1,0,0,0,373,374,5,64,0,0,374,375,5,97,0,0,375,376,5,102,0,0,376,377,5, - 116,0,0,377,378,5,101,0,0,378,379,5,114,0,0,379,56,1,0,0,0,380,381,5,64, - 0,0,381,382,5,103,0,0,382,383,5,108,0,0,383,384,5,111,0,0,384,385,5,98, - 0,0,385,386,5,97,0,0,386,387,5,108,0,0,387,58,1,0,0,0,388,389,5,64,0,0, - 389,390,5,99,0,0,390,391,5,114,0,0,391,392,5,101,0,0,392,393,5,97,0,0, - 393,394,5,116,0,0,394,395,5,101,0,0,395,396,5,45,0,0,396,397,5,99,0,0, - 397,398,5,111,0,0,398,399,5,110,0,0,399,400,5,102,0,0,400,401,5,105,0, - 0,401,402,5,103,0,0,402,60,1,0,0,0,403,404,5,64,0,0,404,405,5,117,0,0, - 405,406,5,112,0,0,406,407,5,100,0,0,407,408,5,97,0,0,408,409,5,116,0,0, - 409,410,5,101,0,0,410,411,5,45,0,0,411,412,5,99,0,0,412,413,5,111,0,0, - 413,414,5,110,0,0,414,415,5,102,0,0,415,416,5,105,0,0,416,417,5,103,0, - 0,417,62,1,0,0,0,418,419,5,123,0,0,419,64,1,0,0,0,420,421,5,125,0,0,421, - 66,1,0,0,0,422,423,5,40,0,0,423,68,1,0,0,0,424,425,5,41,0,0,425,70,1,0, - 0,0,426,427,5,91,0,0,427,72,1,0,0,0,428,429,5,93,0,0,429,74,1,0,0,0,430, - 431,5,59,0,0,431,76,1,0,0,0,432,433,5,58,0,0,433,78,1,0,0,0,434,435,5, - 44,0,0,435,80,1,0,0,0,436,437,5,43,0,0,437,82,1,0,0,0,438,439,5,45,0,0, - 439,84,1,0,0,0,440,441,5,42,0,0,441,86,1,0,0,0,442,443,5,47,0,0,443,88, - 1,0,0,0,444,445,5,37,0,0,445,90,1,0,0,0,446,447,5,110,0,0,447,448,5,111, - 0,0,448,449,5,116,0,0,449,92,1,0,0,0,450,451,5,62,0,0,451,94,1,0,0,0,452, - 453,5,62,0,0,453,454,5,61,0,0,454,96,1,0,0,0,455,456,5,60,0,0,456,98,1, - 0,0,0,457,458,5,60,0,0,458,459,5,61,0,0,459,100,1,0,0,0,460,461,5,61,0, - 0,461,462,5,61,0,0,462,102,1,0,0,0,463,464,5,33,0,0,464,465,5,61,0,0,465, - 104,1,0,0,0,466,467,5,97,0,0,467,468,5,110,0,0,468,469,5,100,0,0,469,106, - 1,0,0,0,470,471,5,111,0,0,471,472,5,114,0,0,472,108,1,0,0,0,473,474,5, - 105,0,0,474,475,5,102,0,0,475,110,1,0,0,0,476,477,5,101,0,0,477,478,5, - 108,0,0,478,479,5,115,0,0,479,480,5,101,0,0,480,112,1,0,0,0,481,482,5, - 126,0,0,482,114,1,0,0,0,483,484,5,110,0,0,484,485,5,117,0,0,485,486,5, - 108,0,0,486,487,5,108,0,0,487,116,1,0,0,0,488,489,5,116,0,0,489,490,5, - 114,0,0,490,491,5,117,0,0,491,492,5,101,0,0,492,118,1,0,0,0,493,494,5, - 102,0,0,494,495,5,97,0,0,495,496,5,108,0,0,496,497,5,115,0,0,497,498,5, - 101,0,0,498,120,1,0,0,0,499,500,5,48,0,0,500,501,5,120,0,0,501,503,1,0, - 0,0,502,504,3,135,67,0,503,502,1,0,0,0,504,505,1,0,0,0,505,503,1,0,0,0, - 505,506,1,0,0,0,506,122,1,0,0,0,507,509,3,133,66,0,508,507,1,0,0,0,509, - 510,1,0,0,0,510,508,1,0,0,0,510,511,1,0,0,0,511,515,1,0,0,0,512,515,3, - 129,64,0,513,515,3,131,65,0,514,508,1,0,0,0,514,512,1,0,0,0,514,513,1, - 0,0,0,515,124,1,0,0,0,516,521,5,34,0,0,517,520,3,137,68,0,518,520,8,4, - 0,0,519,517,1,0,0,0,519,518,1,0,0,0,520,523,1,0,0,0,521,519,1,0,0,0,521, - 522,1,0,0,0,522,524,1,0,0,0,523,521,1,0,0,0,524,535,5,34,0,0,525,530,5, - 39,0,0,526,529,3,137,68,0,527,529,8,5,0,0,528,526,1,0,0,0,528,527,1,0, - 0,0,529,532,1,0,0,0,530,528,1,0,0,0,530,531,1,0,0,0,531,533,1,0,0,0,532, - 530,1,0,0,0,533,535,5,39,0,0,534,516,1,0,0,0,534,525,1,0,0,0,535,126,1, - 0,0,0,536,537,5,64,0,0,537,538,5,100,0,0,538,539,5,101,0,0,539,540,5,108, - 0,0,540,541,5,101,0,0,541,542,5,116,0,0,542,543,5,101,0,0,543,128,1,0, - 0,0,544,546,5,46,0,0,545,547,3,133,66,0,546,545,1,0,0,0,547,548,1,0,0, - 0,548,546,1,0,0,0,548,549,1,0,0,0,549,130,1,0,0,0,550,552,3,133,66,0,551, - 550,1,0,0,0,552,553,1,0,0,0,553,551,1,0,0,0,553,554,1,0,0,0,554,555,1, - 0,0,0,555,557,5,46,0,0,556,558,3,133,66,0,557,556,1,0,0,0,558,559,1,0, - 0,0,559,557,1,0,0,0,559,560,1,0,0,0,560,132,1,0,0,0,561,562,7,6,0,0,562, - 134,1,0,0,0,563,564,7,7,0,0,564,136,1,0,0,0,565,566,5,92,0,0,566,570,7, - 8,0,0,567,570,3,141,70,0,568,570,3,139,69,0,569,565,1,0,0,0,569,567,1, - 0,0,0,569,568,1,0,0,0,570,138,1,0,0,0,571,572,5,92,0,0,572,573,2,48,51, - 0,573,574,2,48,55,0,574,581,2,48,55,0,575,576,5,92,0,0,576,577,2,48,55, - 0,577,581,2,48,55,0,578,579,5,92,0,0,579,581,2,48,55,0,580,571,1,0,0,0, - 580,575,1,0,0,0,580,578,1,0,0,0,581,140,1,0,0,0,582,583,5,92,0,0,583,584, - 5,117,0,0,584,585,3,135,67,0,585,586,3,135,67,0,586,587,3,135,67,0,587, - 588,3,135,67,0,588,142,1,0,0,0,589,595,7,9,0,0,590,594,7,10,0,0,591,592, - 7,11,0,0,592,594,7,12,0,0,593,590,1,0,0,0,593,591,1,0,0,0,594,597,1,0, - 0,0,595,593,1,0,0,0,595,596,1,0,0,0,596,144,1,0,0,0,597,595,1,0,0,0,598, - 604,7,13,0,0,599,603,7,14,0,0,600,601,7,11,0,0,601,603,7,15,0,0,602,599, - 1,0,0,0,602,600,1,0,0,0,603,606,1,0,0,0,604,602,1,0,0,0,604,605,1,0,0, - 0,605,146,1,0,0,0,606,604,1,0,0,0,607,608,5,35,0,0,608,609,3,143,71,0, - 609,148,1,0,0,0,610,611,5,46,0,0,611,612,3,145,72,0,612,150,1,0,0,0,613, - 614,5,36,0,0,614,615,3,145,72,0,615,152,1,0,0,0,616,617,5,36,0,0,617,618, - 5,36,0,0,618,619,1,0,0,0,619,620,3,145,72,0,620,154,1,0,0,0,621,622,5, - 58,0,0,622,623,3,145,72,0,623,156,1,0,0,0,624,625,5,37,0,0,625,626,3,145, - 72,0,626,158,1,0,0,0,627,628,3,145,72,0,628,160,1,0,0,0,26,0,163,173,179, + 69,581,8,69,1,70,1,70,1,70,1,70,1,70,1,70,1,70,1,71,1,71,5,71,592,8,71, + 10,71,12,71,595,9,71,1,72,1,72,1,72,1,72,5,72,601,8,72,10,72,12,72,604, + 9,72,1,73,1,73,1,73,1,74,1,74,1,74,1,75,1,75,1,75,1,76,1,76,1,76,1,76, + 1,76,1,77,1,77,1,77,1,78,1,78,1,78,1,79,1,79,0,0,80,1,1,3,0,5,0,7,2,9, + 3,11,4,13,5,15,6,17,7,19,8,21,9,23,10,25,11,27,12,29,13,31,14,33,15,35, + 16,37,17,39,18,41,19,43,20,45,21,47,22,49,23,51,24,53,25,55,26,57,27,59, + 28,61,29,63,30,65,31,67,32,69,33,71,34,73,35,75,36,77,37,79,38,81,39,83, + 40,85,41,87,42,89,43,91,44,93,45,95,46,97,47,99,48,101,49,103,50,105,51, + 107,52,109,53,111,54,113,55,115,56,117,57,119,58,121,59,123,60,125,61, + 127,62,129,0,131,0,133,0,135,0,137,0,139,0,141,0,143,0,145,0,147,63,149, + 64,151,65,153,66,155,67,157,68,159,69,1,0,15,1,0,42,42,2,0,42,42,47,47, + 2,0,10,10,13,13,3,0,9,10,12,13,32,32,2,0,34,34,92,92,2,0,39,39,92,92,1, + 0,48,57,3,0,48,57,65,70,97,102,8,0,34,34,39,39,92,92,98,98,102,102,110, + 110,114,114,116,116,6,0,42,42,48,57,63,63,65,90,95,95,97,122,7,0,42,42, + 45,46,48,57,63,63,65,90,95,95,97,122,3,0,65,90,95,95,97,122,5,0,46,46, + 48,57,65,90,95,95,97,122,1,0,45,45,2,0,65,90,97,122,642,0,1,1,0,0,0,0, + 7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,0,15,1,0,0,0,0,17,1,0, + 0,0,0,19,1,0,0,0,0,21,1,0,0,0,0,23,1,0,0,0,0,25,1,0,0,0,0,27,1,0,0,0,0, + 29,1,0,0,0,0,31,1,0,0,0,0,33,1,0,0,0,0,35,1,0,0,0,0,37,1,0,0,0,0,39,1, + 0,0,0,0,41,1,0,0,0,0,43,1,0,0,0,0,45,1,0,0,0,0,47,1,0,0,0,0,49,1,0,0,0, + 0,51,1,0,0,0,0,53,1,0,0,0,0,55,1,0,0,0,0,57,1,0,0,0,0,59,1,0,0,0,0,61, + 1,0,0,0,0,63,1,0,0,0,0,65,1,0,0,0,0,67,1,0,0,0,0,69,1,0,0,0,0,71,1,0,0, + 0,0,73,1,0,0,0,0,75,1,0,0,0,0,77,1,0,0,0,0,79,1,0,0,0,0,81,1,0,0,0,0,83, + 1,0,0,0,0,85,1,0,0,0,0,87,1,0,0,0,0,89,1,0,0,0,0,91,1,0,0,0,0,93,1,0,0, + 0,0,95,1,0,0,0,0,97,1,0,0,0,0,99,1,0,0,0,0,101,1,0,0,0,0,103,1,0,0,0,0, + 105,1,0,0,0,0,107,1,0,0,0,0,109,1,0,0,0,0,111,1,0,0,0,0,113,1,0,0,0,0, + 115,1,0,0,0,0,117,1,0,0,0,0,119,1,0,0,0,0,121,1,0,0,0,0,123,1,0,0,0,0, + 125,1,0,0,0,0,127,1,0,0,0,0,147,1,0,0,0,0,149,1,0,0,0,0,151,1,0,0,0,0, + 153,1,0,0,0,0,155,1,0,0,0,0,157,1,0,0,0,0,159,1,0,0,0,1,163,1,0,0,0,3, + 167,1,0,0,0,5,200,1,0,0,0,7,210,1,0,0,0,9,216,1,0,0,0,11,221,1,0,0,0,13, + 231,1,0,0,0,15,235,1,0,0,0,17,241,1,0,0,0,19,250,1,0,0,0,21,257,1,0,0, + 0,23,264,1,0,0,0,25,269,1,0,0,0,27,274,1,0,0,0,29,282,1,0,0,0,31,285,1, + 0,0,0,33,291,1,0,0,0,35,294,1,0,0,0,37,299,1,0,0,0,39,306,1,0,0,0,41,315, + 1,0,0,0,43,322,1,0,0,0,45,336,1,0,0,0,47,345,1,0,0,0,49,353,1,0,0,0,51, + 360,1,0,0,0,53,365,1,0,0,0,55,373,1,0,0,0,57,380,1,0,0,0,59,388,1,0,0, + 0,61,403,1,0,0,0,63,418,1,0,0,0,65,420,1,0,0,0,67,422,1,0,0,0,69,424,1, + 0,0,0,71,426,1,0,0,0,73,428,1,0,0,0,75,430,1,0,0,0,77,432,1,0,0,0,79,434, + 1,0,0,0,81,436,1,0,0,0,83,438,1,0,0,0,85,440,1,0,0,0,87,442,1,0,0,0,89, + 444,1,0,0,0,91,446,1,0,0,0,93,450,1,0,0,0,95,452,1,0,0,0,97,455,1,0,0, + 0,99,457,1,0,0,0,101,460,1,0,0,0,103,463,1,0,0,0,105,466,1,0,0,0,107,470, + 1,0,0,0,109,473,1,0,0,0,111,476,1,0,0,0,113,481,1,0,0,0,115,483,1,0,0, + 0,117,488,1,0,0,0,119,493,1,0,0,0,121,499,1,0,0,0,123,514,1,0,0,0,125, + 534,1,0,0,0,127,536,1,0,0,0,129,544,1,0,0,0,131,551,1,0,0,0,133,561,1, + 0,0,0,135,563,1,0,0,0,137,569,1,0,0,0,139,580,1,0,0,0,141,582,1,0,0,0, + 143,589,1,0,0,0,145,596,1,0,0,0,147,605,1,0,0,0,149,608,1,0,0,0,151,611, + 1,0,0,0,153,614,1,0,0,0,155,619,1,0,0,0,157,622,1,0,0,0,159,625,1,0,0, + 0,161,164,3,5,2,0,162,164,3,3,1,0,163,161,1,0,0,0,163,162,1,0,0,0,164, + 165,1,0,0,0,165,166,6,0,0,0,166,2,1,0,0,0,167,168,5,47,0,0,168,169,5,42, + 0,0,169,173,1,0,0,0,170,172,8,0,0,0,171,170,1,0,0,0,172,175,1,0,0,0,173, + 171,1,0,0,0,173,174,1,0,0,0,174,177,1,0,0,0,175,173,1,0,0,0,176,178,5, + 42,0,0,177,176,1,0,0,0,178,179,1,0,0,0,179,177,1,0,0,0,179,180,1,0,0,0, + 180,195,1,0,0,0,181,185,8,1,0,0,182,184,8,0,0,0,183,182,1,0,0,0,184,187, + 1,0,0,0,185,183,1,0,0,0,185,186,1,0,0,0,186,189,1,0,0,0,187,185,1,0,0, + 0,188,190,5,42,0,0,189,188,1,0,0,0,190,191,1,0,0,0,191,189,1,0,0,0,191, + 192,1,0,0,0,192,194,1,0,0,0,193,181,1,0,0,0,194,197,1,0,0,0,195,193,1, + 0,0,0,195,196,1,0,0,0,196,198,1,0,0,0,197,195,1,0,0,0,198,199,5,47,0,0, + 199,4,1,0,0,0,200,201,5,47,0,0,201,202,5,47,0,0,202,206,1,0,0,0,203,205, + 8,2,0,0,204,203,1,0,0,0,205,208,1,0,0,0,206,204,1,0,0,0,206,207,1,0,0, + 0,207,6,1,0,0,0,208,206,1,0,0,0,209,211,7,3,0,0,210,209,1,0,0,0,211,212, + 1,0,0,0,212,210,1,0,0,0,212,213,1,0,0,0,213,214,1,0,0,0,214,215,6,3,0, + 0,215,8,1,0,0,0,216,217,5,64,0,0,217,218,5,117,0,0,218,219,5,115,0,0,219, + 220,5,101,0,0,220,10,1,0,0,0,221,222,5,64,0,0,222,223,5,102,0,0,223,224, + 5,117,0,0,224,225,5,110,0,0,225,226,5,99,0,0,226,227,5,116,0,0,227,228, + 5,105,0,0,228,229,5,111,0,0,229,230,5,110,0,0,230,12,1,0,0,0,231,232,5, + 64,0,0,232,233,5,105,0,0,233,234,5,102,0,0,234,14,1,0,0,0,235,236,5,64, + 0,0,236,237,5,101,0,0,237,238,5,108,0,0,238,239,5,115,0,0,239,240,5,101, + 0,0,240,16,1,0,0,0,241,242,5,64,0,0,242,243,5,101,0,0,243,244,5,108,0, + 0,244,245,5,115,0,0,245,246,5,101,0,0,246,247,5,45,0,0,247,248,5,105,0, + 0,248,249,5,102,0,0,249,18,1,0,0,0,250,251,5,64,0,0,251,252,5,109,0,0, + 252,253,5,105,0,0,253,254,5,120,0,0,254,255,5,105,0,0,255,256,5,110,0, + 0,256,20,1,0,0,0,257,258,5,64,0,0,258,259,5,119,0,0,259,260,5,104,0,0, + 260,261,5,105,0,0,261,262,5,108,0,0,262,263,5,101,0,0,263,22,1,0,0,0,264, + 265,5,64,0,0,265,266,5,102,0,0,266,267,5,111,0,0,267,268,5,114,0,0,268, + 24,1,0,0,0,269,270,5,102,0,0,270,271,5,114,0,0,271,272,5,111,0,0,272,273, + 5,109,0,0,273,26,1,0,0,0,274,275,5,116,0,0,275,276,5,104,0,0,276,277,5, + 114,0,0,277,278,5,111,0,0,278,279,5,117,0,0,279,280,5,103,0,0,280,281, + 5,104,0,0,281,28,1,0,0,0,282,283,5,116,0,0,283,284,5,111,0,0,284,30,1, + 0,0,0,285,286,5,64,0,0,286,287,5,101,0,0,287,288,5,97,0,0,288,289,5,99, + 0,0,289,290,5,104,0,0,290,32,1,0,0,0,291,292,5,105,0,0,292,293,5,110,0, + 0,293,34,1,0,0,0,294,295,5,64,0,0,295,296,5,115,0,0,296,297,5,101,0,0, + 297,298,5,116,0,0,298,36,1,0,0,0,299,300,5,64,0,0,300,301,5,109,0,0,301, + 302,5,101,0,0,302,303,5,114,0,0,303,304,5,103,0,0,304,305,5,101,0,0,305, + 38,1,0,0,0,306,307,5,64,0,0,307,308,5,114,0,0,308,309,5,101,0,0,309,310, + 5,113,0,0,310,311,5,117,0,0,311,312,5,105,0,0,312,313,5,114,0,0,313,314, + 5,101,0,0,314,40,1,0,0,0,315,316,5,64,0,0,316,317,5,115,0,0,317,318,5, + 116,0,0,318,319,5,97,0,0,319,320,5,103,0,0,320,321,5,101,0,0,321,42,1, + 0,0,0,322,323,5,64,0,0,323,324,5,100,0,0,324,325,5,101,0,0,325,326,5,102, + 0,0,326,327,5,105,0,0,327,328,5,110,0,0,328,329,5,101,0,0,329,330,5,45, + 0,0,330,331,5,115,0,0,331,332,5,116,0,0,332,333,5,97,0,0,333,334,5,103, + 0,0,334,335,5,101,0,0,335,44,1,0,0,0,336,337,5,64,0,0,337,338,5,105,0, + 0,338,339,5,110,0,0,339,340,5,99,0,0,340,341,5,108,0,0,341,342,5,117,0, + 0,342,343,5,100,0,0,343,344,5,101,0,0,344,46,1,0,0,0,345,346,5,64,0,0, + 346,347,5,114,0,0,347,348,5,101,0,0,348,349,5,116,0,0,349,350,5,117,0, + 0,350,351,5,114,0,0,351,352,5,110,0,0,352,48,1,0,0,0,353,354,5,64,0,0, + 354,355,5,112,0,0,355,356,5,97,0,0,356,357,5,116,0,0,357,358,5,99,0,0, + 358,359,5,104,0,0,359,50,1,0,0,0,360,361,5,64,0,0,361,362,5,110,0,0,362, + 363,5,101,0,0,363,364,5,119,0,0,364,52,1,0,0,0,365,366,5,64,0,0,366,367, + 5,98,0,0,367,368,5,101,0,0,368,369,5,102,0,0,369,370,5,111,0,0,370,371, + 5,114,0,0,371,372,5,101,0,0,372,54,1,0,0,0,373,374,5,64,0,0,374,375,5, + 97,0,0,375,376,5,102,0,0,376,377,5,116,0,0,377,378,5,101,0,0,378,379,5, + 114,0,0,379,56,1,0,0,0,380,381,5,64,0,0,381,382,5,103,0,0,382,383,5,108, + 0,0,383,384,5,111,0,0,384,385,5,98,0,0,385,386,5,97,0,0,386,387,5,108, + 0,0,387,58,1,0,0,0,388,389,5,64,0,0,389,390,5,99,0,0,390,391,5,114,0,0, + 391,392,5,101,0,0,392,393,5,97,0,0,393,394,5,116,0,0,394,395,5,101,0,0, + 395,396,5,45,0,0,396,397,5,99,0,0,397,398,5,111,0,0,398,399,5,110,0,0, + 399,400,5,102,0,0,400,401,5,105,0,0,401,402,5,103,0,0,402,60,1,0,0,0,403, + 404,5,64,0,0,404,405,5,117,0,0,405,406,5,112,0,0,406,407,5,100,0,0,407, + 408,5,97,0,0,408,409,5,116,0,0,409,410,5,101,0,0,410,411,5,45,0,0,411, + 412,5,99,0,0,412,413,5,111,0,0,413,414,5,110,0,0,414,415,5,102,0,0,415, + 416,5,105,0,0,416,417,5,103,0,0,417,62,1,0,0,0,418,419,5,123,0,0,419,64, + 1,0,0,0,420,421,5,125,0,0,421,66,1,0,0,0,422,423,5,40,0,0,423,68,1,0,0, + 0,424,425,5,41,0,0,425,70,1,0,0,0,426,427,5,91,0,0,427,72,1,0,0,0,428, + 429,5,93,0,0,429,74,1,0,0,0,430,431,5,59,0,0,431,76,1,0,0,0,432,433,5, + 58,0,0,433,78,1,0,0,0,434,435,5,44,0,0,435,80,1,0,0,0,436,437,5,43,0,0, + 437,82,1,0,0,0,438,439,5,45,0,0,439,84,1,0,0,0,440,441,5,42,0,0,441,86, + 1,0,0,0,442,443,5,47,0,0,443,88,1,0,0,0,444,445,5,37,0,0,445,90,1,0,0, + 0,446,447,5,110,0,0,447,448,5,111,0,0,448,449,5,116,0,0,449,92,1,0,0,0, + 450,451,5,62,0,0,451,94,1,0,0,0,452,453,5,62,0,0,453,454,5,61,0,0,454, + 96,1,0,0,0,455,456,5,60,0,0,456,98,1,0,0,0,457,458,5,60,0,0,458,459,5, + 61,0,0,459,100,1,0,0,0,460,461,5,61,0,0,461,462,5,61,0,0,462,102,1,0,0, + 0,463,464,5,33,0,0,464,465,5,61,0,0,465,104,1,0,0,0,466,467,5,97,0,0,467, + 468,5,110,0,0,468,469,5,100,0,0,469,106,1,0,0,0,470,471,5,111,0,0,471, + 472,5,114,0,0,472,108,1,0,0,0,473,474,5,105,0,0,474,475,5,102,0,0,475, + 110,1,0,0,0,476,477,5,101,0,0,477,478,5,108,0,0,478,479,5,115,0,0,479, + 480,5,101,0,0,480,112,1,0,0,0,481,482,5,126,0,0,482,114,1,0,0,0,483,484, + 5,110,0,0,484,485,5,117,0,0,485,486,5,108,0,0,486,487,5,108,0,0,487,116, + 1,0,0,0,488,489,5,116,0,0,489,490,5,114,0,0,490,491,5,117,0,0,491,492, + 5,101,0,0,492,118,1,0,0,0,493,494,5,102,0,0,494,495,5,97,0,0,495,496,5, + 108,0,0,496,497,5,115,0,0,497,498,5,101,0,0,498,120,1,0,0,0,499,500,5, + 48,0,0,500,501,5,120,0,0,501,503,1,0,0,0,502,504,3,135,67,0,503,502,1, + 0,0,0,504,505,1,0,0,0,505,503,1,0,0,0,505,506,1,0,0,0,506,122,1,0,0,0, + 507,509,3,133,66,0,508,507,1,0,0,0,509,510,1,0,0,0,510,508,1,0,0,0,510, + 511,1,0,0,0,511,515,1,0,0,0,512,515,3,129,64,0,513,515,3,131,65,0,514, + 508,1,0,0,0,514,512,1,0,0,0,514,513,1,0,0,0,515,124,1,0,0,0,516,521,5, + 34,0,0,517,520,3,137,68,0,518,520,8,4,0,0,519,517,1,0,0,0,519,518,1,0, + 0,0,520,523,1,0,0,0,521,519,1,0,0,0,521,522,1,0,0,0,522,524,1,0,0,0,523, + 521,1,0,0,0,524,535,5,34,0,0,525,530,5,39,0,0,526,529,3,137,68,0,527,529, + 8,5,0,0,528,526,1,0,0,0,528,527,1,0,0,0,529,532,1,0,0,0,530,528,1,0,0, + 0,530,531,1,0,0,0,531,533,1,0,0,0,532,530,1,0,0,0,533,535,5,39,0,0,534, + 516,1,0,0,0,534,525,1,0,0,0,535,126,1,0,0,0,536,537,5,64,0,0,537,538,5, + 100,0,0,538,539,5,101,0,0,539,540,5,108,0,0,540,541,5,101,0,0,541,542, + 5,116,0,0,542,543,5,101,0,0,543,128,1,0,0,0,544,546,5,46,0,0,545,547,3, + 133,66,0,546,545,1,0,0,0,547,548,1,0,0,0,548,546,1,0,0,0,548,549,1,0,0, + 0,549,130,1,0,0,0,550,552,3,133,66,0,551,550,1,0,0,0,552,553,1,0,0,0,553, + 551,1,0,0,0,553,554,1,0,0,0,554,555,1,0,0,0,555,557,5,46,0,0,556,558,3, + 133,66,0,557,556,1,0,0,0,558,559,1,0,0,0,559,557,1,0,0,0,559,560,1,0,0, + 0,560,132,1,0,0,0,561,562,7,6,0,0,562,134,1,0,0,0,563,564,7,7,0,0,564, + 136,1,0,0,0,565,566,5,92,0,0,566,570,7,8,0,0,567,570,3,141,70,0,568,570, + 3,139,69,0,569,565,1,0,0,0,569,567,1,0,0,0,569,568,1,0,0,0,570,138,1,0, + 0,0,571,572,5,92,0,0,572,573,2,48,51,0,573,574,2,48,55,0,574,581,2,48, + 55,0,575,576,5,92,0,0,576,577,2,48,55,0,577,581,2,48,55,0,578,579,5,92, + 0,0,579,581,2,48,55,0,580,571,1,0,0,0,580,575,1,0,0,0,580,578,1,0,0,0, + 581,140,1,0,0,0,582,583,5,92,0,0,583,584,5,117,0,0,584,585,3,135,67,0, + 585,586,3,135,67,0,586,587,3,135,67,0,587,588,3,135,67,0,588,142,1,0,0, + 0,589,593,7,9,0,0,590,592,7,10,0,0,591,590,1,0,0,0,592,595,1,0,0,0,593, + 591,1,0,0,0,593,594,1,0,0,0,594,144,1,0,0,0,595,593,1,0,0,0,596,602,7, + 11,0,0,597,601,7,12,0,0,598,599,7,13,0,0,599,601,7,14,0,0,600,597,1,0, + 0,0,600,598,1,0,0,0,601,604,1,0,0,0,602,600,1,0,0,0,602,603,1,0,0,0,603, + 146,1,0,0,0,604,602,1,0,0,0,605,606,5,35,0,0,606,607,3,143,71,0,607,148, + 1,0,0,0,608,609,5,46,0,0,609,610,3,145,72,0,610,150,1,0,0,0,611,612,5, + 36,0,0,612,613,3,145,72,0,613,152,1,0,0,0,614,615,5,36,0,0,615,616,5,36, + 0,0,616,617,1,0,0,0,617,618,3,145,72,0,618,154,1,0,0,0,619,620,5,58,0, + 0,620,621,3,145,72,0,621,156,1,0,0,0,622,623,5,37,0,0,623,624,3,145,72, + 0,624,158,1,0,0,0,625,626,3,145,72,0,626,160,1,0,0,0,25,0,163,173,179, 185,191,195,206,212,505,510,514,519,521,528,530,534,548,553,559,569,580, - 593,595,602,604,1,6,0,0 + 593,600,602,1,6,0,0 }; public static readonly ATN _ATN = diff --git a/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.g4 b/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.g4 index 21510e6..ca765be 100644 --- a/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.g4 +++ b/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.g4 @@ -116,7 +116,7 @@ UNICODE_ESC : '\\' 'u' HEX_DIGIT HEX_DIGIT HEX_DIGIT HEX_DIGIT ; -fragment IDENTIFIER : [a-zA-Z_*?]([a-zA-Z_.*?0-9]|[\-][a-zA-Z*?])*; +fragment IDENTIFIER : [a-zA-Z_*?0-9]([a-zA-Z_.*?0-9\-])*; fragment WILDCARDLESS_IDENTIFIER : [a-zA-Z_]([a-zA-Z_.0-9]|[\-][a-zA-Z])*; NAME : '#' IDENTIFIER; diff --git a/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.interp b/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.interp index 566d425..acafcc6 100644 --- a/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.interp +++ b/src/PatchManager.SassyPatching/SassyPatchGrammar/sassy_lexer.interp @@ -232,4 +232,4 @@ mode names: DEFAULT_MODE atn: -[4, 0, 69, 629, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 1, 0, 1, 0, 3, 0, 164, 8, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 172, 8, 1, 10, 1, 12, 1, 175, 9, 1, 1, 1, 4, 1, 178, 8, 1, 11, 1, 12, 1, 179, 1, 1, 1, 1, 5, 1, 184, 8, 1, 10, 1, 12, 1, 187, 9, 1, 1, 1, 4, 1, 190, 8, 1, 11, 1, 12, 1, 191, 5, 1, 194, 8, 1, 10, 1, 12, 1, 197, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 205, 8, 2, 10, 2, 12, 2, 208, 9, 2, 1, 3, 4, 3, 211, 8, 3, 11, 3, 12, 3, 212, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 4, 60, 504, 8, 60, 11, 60, 12, 60, 505, 1, 61, 4, 61, 509, 8, 61, 11, 61, 12, 61, 510, 1, 61, 1, 61, 3, 61, 515, 8, 61, 1, 62, 1, 62, 1, 62, 5, 62, 520, 8, 62, 10, 62, 12, 62, 523, 9, 62, 1, 62, 1, 62, 1, 62, 1, 62, 5, 62, 529, 8, 62, 10, 62, 12, 62, 532, 9, 62, 1, 62, 3, 62, 535, 8, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 4, 64, 547, 8, 64, 11, 64, 12, 64, 548, 1, 65, 4, 65, 552, 8, 65, 11, 65, 12, 65, 553, 1, 65, 1, 65, 4, 65, 558, 8, 65, 11, 65, 12, 65, 559, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 3, 68, 570, 8, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 581, 8, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 1, 71, 1, 71, 5, 71, 594, 8, 71, 10, 71, 12, 71, 597, 9, 71, 1, 72, 1, 72, 1, 72, 1, 72, 5, 72, 603, 8, 72, 10, 72, 12, 72, 606, 9, 72, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 0, 0, 80, 1, 1, 3, 0, 5, 0, 7, 2, 9, 3, 11, 4, 13, 5, 15, 6, 17, 7, 19, 8, 21, 9, 23, 10, 25, 11, 27, 12, 29, 13, 31, 14, 33, 15, 35, 16, 37, 17, 39, 18, 41, 19, 43, 20, 45, 21, 47, 22, 49, 23, 51, 24, 53, 25, 55, 26, 57, 27, 59, 28, 61, 29, 63, 30, 65, 31, 67, 32, 69, 33, 71, 34, 73, 35, 75, 36, 77, 37, 79, 38, 81, 39, 83, 40, 85, 41, 87, 42, 89, 43, 91, 44, 93, 45, 95, 46, 97, 47, 99, 48, 101, 49, 103, 50, 105, 51, 107, 52, 109, 53, 111, 54, 113, 55, 115, 56, 117, 57, 119, 58, 121, 59, 123, 60, 125, 61, 127, 62, 129, 0, 131, 0, 133, 0, 135, 0, 137, 0, 139, 0, 141, 0, 143, 0, 145, 0, 147, 63, 149, 64, 151, 65, 153, 66, 155, 67, 157, 68, 159, 69, 1, 0, 16, 1, 0, 42, 42, 2, 0, 42, 42, 47, 47, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 12, 13, 32, 32, 2, 0, 34, 34, 92, 92, 2, 0, 39, 39, 92, 92, 1, 0, 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 8, 0, 34, 34, 39, 39, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 5, 0, 42, 42, 63, 63, 65, 90, 95, 95, 97, 122, 7, 0, 42, 42, 46, 46, 48, 57, 63, 63, 65, 90, 95, 95, 97, 122, 1, 0, 45, 45, 4, 0, 42, 42, 63, 63, 65, 90, 97, 122, 3, 0, 65, 90, 95, 95, 97, 122, 5, 0, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 2, 0, 65, 90, 97, 122, 645, 0, 1, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 147, 1, 0, 0, 0, 0, 149, 1, 0, 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1, 0, 0, 0, 0, 155, 1, 0, 0, 0, 0, 157, 1, 0, 0, 0, 0, 159, 1, 0, 0, 0, 1, 163, 1, 0, 0, 0, 3, 167, 1, 0, 0, 0, 5, 200, 1, 0, 0, 0, 7, 210, 1, 0, 0, 0, 9, 216, 1, 0, 0, 0, 11, 221, 1, 0, 0, 0, 13, 231, 1, 0, 0, 0, 15, 235, 1, 0, 0, 0, 17, 241, 1, 0, 0, 0, 19, 250, 1, 0, 0, 0, 21, 257, 1, 0, 0, 0, 23, 264, 1, 0, 0, 0, 25, 269, 1, 0, 0, 0, 27, 274, 1, 0, 0, 0, 29, 282, 1, 0, 0, 0, 31, 285, 1, 0, 0, 0, 33, 291, 1, 0, 0, 0, 35, 294, 1, 0, 0, 0, 37, 299, 1, 0, 0, 0, 39, 306, 1, 0, 0, 0, 41, 315, 1, 0, 0, 0, 43, 322, 1, 0, 0, 0, 45, 336, 1, 0, 0, 0, 47, 345, 1, 0, 0, 0, 49, 353, 1, 0, 0, 0, 51, 360, 1, 0, 0, 0, 53, 365, 1, 0, 0, 0, 55, 373, 1, 0, 0, 0, 57, 380, 1, 0, 0, 0, 59, 388, 1, 0, 0, 0, 61, 403, 1, 0, 0, 0, 63, 418, 1, 0, 0, 0, 65, 420, 1, 0, 0, 0, 67, 422, 1, 0, 0, 0, 69, 424, 1, 0, 0, 0, 71, 426, 1, 0, 0, 0, 73, 428, 1, 0, 0, 0, 75, 430, 1, 0, 0, 0, 77, 432, 1, 0, 0, 0, 79, 434, 1, 0, 0, 0, 81, 436, 1, 0, 0, 0, 83, 438, 1, 0, 0, 0, 85, 440, 1, 0, 0, 0, 87, 442, 1, 0, 0, 0, 89, 444, 1, 0, 0, 0, 91, 446, 1, 0, 0, 0, 93, 450, 1, 0, 0, 0, 95, 452, 1, 0, 0, 0, 97, 455, 1, 0, 0, 0, 99, 457, 1, 0, 0, 0, 101, 460, 1, 0, 0, 0, 103, 463, 1, 0, 0, 0, 105, 466, 1, 0, 0, 0, 107, 470, 1, 0, 0, 0, 109, 473, 1, 0, 0, 0, 111, 476, 1, 0, 0, 0, 113, 481, 1, 0, 0, 0, 115, 483, 1, 0, 0, 0, 117, 488, 1, 0, 0, 0, 119, 493, 1, 0, 0, 0, 121, 499, 1, 0, 0, 0, 123, 514, 1, 0, 0, 0, 125, 534, 1, 0, 0, 0, 127, 536, 1, 0, 0, 0, 129, 544, 1, 0, 0, 0, 131, 551, 1, 0, 0, 0, 133, 561, 1, 0, 0, 0, 135, 563, 1, 0, 0, 0, 137, 569, 1, 0, 0, 0, 139, 580, 1, 0, 0, 0, 141, 582, 1, 0, 0, 0, 143, 589, 1, 0, 0, 0, 145, 598, 1, 0, 0, 0, 147, 607, 1, 0, 0, 0, 149, 610, 1, 0, 0, 0, 151, 613, 1, 0, 0, 0, 153, 616, 1, 0, 0, 0, 155, 621, 1, 0, 0, 0, 157, 624, 1, 0, 0, 0, 159, 627, 1, 0, 0, 0, 161, 164, 3, 5, 2, 0, 162, 164, 3, 3, 1, 0, 163, 161, 1, 0, 0, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 166, 6, 0, 0, 0, 166, 2, 1, 0, 0, 0, 167, 168, 5, 47, 0, 0, 168, 169, 5, 42, 0, 0, 169, 173, 1, 0, 0, 0, 170, 172, 8, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 178, 5, 42, 0, 0, 177, 176, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, 195, 1, 0, 0, 0, 181, 185, 8, 1, 0, 0, 182, 184, 8, 0, 0, 0, 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 190, 5, 42, 0, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 194, 1, 0, 0, 0, 193, 181, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199, 5, 47, 0, 0, 199, 4, 1, 0, 0, 0, 200, 201, 5, 47, 0, 0, 201, 202, 5, 47, 0, 0, 202, 206, 1, 0, 0, 0, 203, 205, 8, 2, 0, 0, 204, 203, 1, 0, 0, 0, 205, 208, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 6, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 209, 211, 7, 3, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 6, 3, 0, 0, 215, 8, 1, 0, 0, 0, 216, 217, 5, 64, 0, 0, 217, 218, 5, 117, 0, 0, 218, 219, 5, 115, 0, 0, 219, 220, 5, 101, 0, 0, 220, 10, 1, 0, 0, 0, 221, 222, 5, 64, 0, 0, 222, 223, 5, 102, 0, 0, 223, 224, 5, 117, 0, 0, 224, 225, 5, 110, 0, 0, 225, 226, 5, 99, 0, 0, 226, 227, 5, 116, 0, 0, 227, 228, 5, 105, 0, 0, 228, 229, 5, 111, 0, 0, 229, 230, 5, 110, 0, 0, 230, 12, 1, 0, 0, 0, 231, 232, 5, 64, 0, 0, 232, 233, 5, 105, 0, 0, 233, 234, 5, 102, 0, 0, 234, 14, 1, 0, 0, 0, 235, 236, 5, 64, 0, 0, 236, 237, 5, 101, 0, 0, 237, 238, 5, 108, 0, 0, 238, 239, 5, 115, 0, 0, 239, 240, 5, 101, 0, 0, 240, 16, 1, 0, 0, 0, 241, 242, 5, 64, 0, 0, 242, 243, 5, 101, 0, 0, 243, 244, 5, 108, 0, 0, 244, 245, 5, 115, 0, 0, 245, 246, 5, 101, 0, 0, 246, 247, 5, 45, 0, 0, 247, 248, 5, 105, 0, 0, 248, 249, 5, 102, 0, 0, 249, 18, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 252, 5, 109, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 120, 0, 0, 254, 255, 5, 105, 0, 0, 255, 256, 5, 110, 0, 0, 256, 20, 1, 0, 0, 0, 257, 258, 5, 64, 0, 0, 258, 259, 5, 119, 0, 0, 259, 260, 5, 104, 0, 0, 260, 261, 5, 105, 0, 0, 261, 262, 5, 108, 0, 0, 262, 263, 5, 101, 0, 0, 263, 22, 1, 0, 0, 0, 264, 265, 5, 64, 0, 0, 265, 266, 5, 102, 0, 0, 266, 267, 5, 111, 0, 0, 267, 268, 5, 114, 0, 0, 268, 24, 1, 0, 0, 0, 269, 270, 5, 102, 0, 0, 270, 271, 5, 114, 0, 0, 271, 272, 5, 111, 0, 0, 272, 273, 5, 109, 0, 0, 273, 26, 1, 0, 0, 0, 274, 275, 5, 116, 0, 0, 275, 276, 5, 104, 0, 0, 276, 277, 5, 114, 0, 0, 277, 278, 5, 111, 0, 0, 278, 279, 5, 117, 0, 0, 279, 280, 5, 103, 0, 0, 280, 281, 5, 104, 0, 0, 281, 28, 1, 0, 0, 0, 282, 283, 5, 116, 0, 0, 283, 284, 5, 111, 0, 0, 284, 30, 1, 0, 0, 0, 285, 286, 5, 64, 0, 0, 286, 287, 5, 101, 0, 0, 287, 288, 5, 97, 0, 0, 288, 289, 5, 99, 0, 0, 289, 290, 5, 104, 0, 0, 290, 32, 1, 0, 0, 0, 291, 292, 5, 105, 0, 0, 292, 293, 5, 110, 0, 0, 293, 34, 1, 0, 0, 0, 294, 295, 5, 64, 0, 0, 295, 296, 5, 115, 0, 0, 296, 297, 5, 101, 0, 0, 297, 298, 5, 116, 0, 0, 298, 36, 1, 0, 0, 0, 299, 300, 5, 64, 0, 0, 300, 301, 5, 109, 0, 0, 301, 302, 5, 101, 0, 0, 302, 303, 5, 114, 0, 0, 303, 304, 5, 103, 0, 0, 304, 305, 5, 101, 0, 0, 305, 38, 1, 0, 0, 0, 306, 307, 5, 64, 0, 0, 307, 308, 5, 114, 0, 0, 308, 309, 5, 101, 0, 0, 309, 310, 5, 113, 0, 0, 310, 311, 5, 117, 0, 0, 311, 312, 5, 105, 0, 0, 312, 313, 5, 114, 0, 0, 313, 314, 5, 101, 0, 0, 314, 40, 1, 0, 0, 0, 315, 316, 5, 64, 0, 0, 316, 317, 5, 115, 0, 0, 317, 318, 5, 116, 0, 0, 318, 319, 5, 97, 0, 0, 319, 320, 5, 103, 0, 0, 320, 321, 5, 101, 0, 0, 321, 42, 1, 0, 0, 0, 322, 323, 5, 64, 0, 0, 323, 324, 5, 100, 0, 0, 324, 325, 5, 101, 0, 0, 325, 326, 5, 102, 0, 0, 326, 327, 5, 105, 0, 0, 327, 328, 5, 110, 0, 0, 328, 329, 5, 101, 0, 0, 329, 330, 5, 45, 0, 0, 330, 331, 5, 115, 0, 0, 331, 332, 5, 116, 0, 0, 332, 333, 5, 97, 0, 0, 333, 334, 5, 103, 0, 0, 334, 335, 5, 101, 0, 0, 335, 44, 1, 0, 0, 0, 336, 337, 5, 64, 0, 0, 337, 338, 5, 105, 0, 0, 338, 339, 5, 110, 0, 0, 339, 340, 5, 99, 0, 0, 340, 341, 5, 108, 0, 0, 341, 342, 5, 117, 0, 0, 342, 343, 5, 100, 0, 0, 343, 344, 5, 101, 0, 0, 344, 46, 1, 0, 0, 0, 345, 346, 5, 64, 0, 0, 346, 347, 5, 114, 0, 0, 347, 348, 5, 101, 0, 0, 348, 349, 5, 116, 0, 0, 349, 350, 5, 117, 0, 0, 350, 351, 5, 114, 0, 0, 351, 352, 5, 110, 0, 0, 352, 48, 1, 0, 0, 0, 353, 354, 5, 64, 0, 0, 354, 355, 5, 112, 0, 0, 355, 356, 5, 97, 0, 0, 356, 357, 5, 116, 0, 0, 357, 358, 5, 99, 0, 0, 358, 359, 5, 104, 0, 0, 359, 50, 1, 0, 0, 0, 360, 361, 5, 64, 0, 0, 361, 362, 5, 110, 0, 0, 362, 363, 5, 101, 0, 0, 363, 364, 5, 119, 0, 0, 364, 52, 1, 0, 0, 0, 365, 366, 5, 64, 0, 0, 366, 367, 5, 98, 0, 0, 367, 368, 5, 101, 0, 0, 368, 369, 5, 102, 0, 0, 369, 370, 5, 111, 0, 0, 370, 371, 5, 114, 0, 0, 371, 372, 5, 101, 0, 0, 372, 54, 1, 0, 0, 0, 373, 374, 5, 64, 0, 0, 374, 375, 5, 97, 0, 0, 375, 376, 5, 102, 0, 0, 376, 377, 5, 116, 0, 0, 377, 378, 5, 101, 0, 0, 378, 379, 5, 114, 0, 0, 379, 56, 1, 0, 0, 0, 380, 381, 5, 64, 0, 0, 381, 382, 5, 103, 0, 0, 382, 383, 5, 108, 0, 0, 383, 384, 5, 111, 0, 0, 384, 385, 5, 98, 0, 0, 385, 386, 5, 97, 0, 0, 386, 387, 5, 108, 0, 0, 387, 58, 1, 0, 0, 0, 388, 389, 5, 64, 0, 0, 389, 390, 5, 99, 0, 0, 390, 391, 5, 114, 0, 0, 391, 392, 5, 101, 0, 0, 392, 393, 5, 97, 0, 0, 393, 394, 5, 116, 0, 0, 394, 395, 5, 101, 0, 0, 395, 396, 5, 45, 0, 0, 396, 397, 5, 99, 0, 0, 397, 398, 5, 111, 0, 0, 398, 399, 5, 110, 0, 0, 399, 400, 5, 102, 0, 0, 400, 401, 5, 105, 0, 0, 401, 402, 5, 103, 0, 0, 402, 60, 1, 0, 0, 0, 403, 404, 5, 64, 0, 0, 404, 405, 5, 117, 0, 0, 405, 406, 5, 112, 0, 0, 406, 407, 5, 100, 0, 0, 407, 408, 5, 97, 0, 0, 408, 409, 5, 116, 0, 0, 409, 410, 5, 101, 0, 0, 410, 411, 5, 45, 0, 0, 411, 412, 5, 99, 0, 0, 412, 413, 5, 111, 0, 0, 413, 414, 5, 110, 0, 0, 414, 415, 5, 102, 0, 0, 415, 416, 5, 105, 0, 0, 416, 417, 5, 103, 0, 0, 417, 62, 1, 0, 0, 0, 418, 419, 5, 123, 0, 0, 419, 64, 1, 0, 0, 0, 420, 421, 5, 125, 0, 0, 421, 66, 1, 0, 0, 0, 422, 423, 5, 40, 0, 0, 423, 68, 1, 0, 0, 0, 424, 425, 5, 41, 0, 0, 425, 70, 1, 0, 0, 0, 426, 427, 5, 91, 0, 0, 427, 72, 1, 0, 0, 0, 428, 429, 5, 93, 0, 0, 429, 74, 1, 0, 0, 0, 430, 431, 5, 59, 0, 0, 431, 76, 1, 0, 0, 0, 432, 433, 5, 58, 0, 0, 433, 78, 1, 0, 0, 0, 434, 435, 5, 44, 0, 0, 435, 80, 1, 0, 0, 0, 436, 437, 5, 43, 0, 0, 437, 82, 1, 0, 0, 0, 438, 439, 5, 45, 0, 0, 439, 84, 1, 0, 0, 0, 440, 441, 5, 42, 0, 0, 441, 86, 1, 0, 0, 0, 442, 443, 5, 47, 0, 0, 443, 88, 1, 0, 0, 0, 444, 445, 5, 37, 0, 0, 445, 90, 1, 0, 0, 0, 446, 447, 5, 110, 0, 0, 447, 448, 5, 111, 0, 0, 448, 449, 5, 116, 0, 0, 449, 92, 1, 0, 0, 0, 450, 451, 5, 62, 0, 0, 451, 94, 1, 0, 0, 0, 452, 453, 5, 62, 0, 0, 453, 454, 5, 61, 0, 0, 454, 96, 1, 0, 0, 0, 455, 456, 5, 60, 0, 0, 456, 98, 1, 0, 0, 0, 457, 458, 5, 60, 0, 0, 458, 459, 5, 61, 0, 0, 459, 100, 1, 0, 0, 0, 460, 461, 5, 61, 0, 0, 461, 462, 5, 61, 0, 0, 462, 102, 1, 0, 0, 0, 463, 464, 5, 33, 0, 0, 464, 465, 5, 61, 0, 0, 465, 104, 1, 0, 0, 0, 466, 467, 5, 97, 0, 0, 467, 468, 5, 110, 0, 0, 468, 469, 5, 100, 0, 0, 469, 106, 1, 0, 0, 0, 470, 471, 5, 111, 0, 0, 471, 472, 5, 114, 0, 0, 472, 108, 1, 0, 0, 0, 473, 474, 5, 105, 0, 0, 474, 475, 5, 102, 0, 0, 475, 110, 1, 0, 0, 0, 476, 477, 5, 101, 0, 0, 477, 478, 5, 108, 0, 0, 478, 479, 5, 115, 0, 0, 479, 480, 5, 101, 0, 0, 480, 112, 1, 0, 0, 0, 481, 482, 5, 126, 0, 0, 482, 114, 1, 0, 0, 0, 483, 484, 5, 110, 0, 0, 484, 485, 5, 117, 0, 0, 485, 486, 5, 108, 0, 0, 486, 487, 5, 108, 0, 0, 487, 116, 1, 0, 0, 0, 488, 489, 5, 116, 0, 0, 489, 490, 5, 114, 0, 0, 490, 491, 5, 117, 0, 0, 491, 492, 5, 101, 0, 0, 492, 118, 1, 0, 0, 0, 493, 494, 5, 102, 0, 0, 494, 495, 5, 97, 0, 0, 495, 496, 5, 108, 0, 0, 496, 497, 5, 115, 0, 0, 497, 498, 5, 101, 0, 0, 498, 120, 1, 0, 0, 0, 499, 500, 5, 48, 0, 0, 500, 501, 5, 120, 0, 0, 501, 503, 1, 0, 0, 0, 502, 504, 3, 135, 67, 0, 503, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 503, 1, 0, 0, 0, 505, 506, 1, 0, 0, 0, 506, 122, 1, 0, 0, 0, 507, 509, 3, 133, 66, 0, 508, 507, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 515, 1, 0, 0, 0, 512, 515, 3, 129, 64, 0, 513, 515, 3, 131, 65, 0, 514, 508, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 514, 513, 1, 0, 0, 0, 515, 124, 1, 0, 0, 0, 516, 521, 5, 34, 0, 0, 517, 520, 3, 137, 68, 0, 518, 520, 8, 4, 0, 0, 519, 517, 1, 0, 0, 0, 519, 518, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 519, 1, 0, 0, 0, 521, 522, 1, 0, 0, 0, 522, 524, 1, 0, 0, 0, 523, 521, 1, 0, 0, 0, 524, 535, 5, 34, 0, 0, 525, 530, 5, 39, 0, 0, 526, 529, 3, 137, 68, 0, 527, 529, 8, 5, 0, 0, 528, 526, 1, 0, 0, 0, 528, 527, 1, 0, 0, 0, 529, 532, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 533, 1, 0, 0, 0, 532, 530, 1, 0, 0, 0, 533, 535, 5, 39, 0, 0, 534, 516, 1, 0, 0, 0, 534, 525, 1, 0, 0, 0, 535, 126, 1, 0, 0, 0, 536, 537, 5, 64, 0, 0, 537, 538, 5, 100, 0, 0, 538, 539, 5, 101, 0, 0, 539, 540, 5, 108, 0, 0, 540, 541, 5, 101, 0, 0, 541, 542, 5, 116, 0, 0, 542, 543, 5, 101, 0, 0, 543, 128, 1, 0, 0, 0, 544, 546, 5, 46, 0, 0, 545, 547, 3, 133, 66, 0, 546, 545, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 546, 1, 0, 0, 0, 548, 549, 1, 0, 0, 0, 549, 130, 1, 0, 0, 0, 550, 552, 3, 133, 66, 0, 551, 550, 1, 0, 0, 0, 552, 553, 1, 0, 0, 0, 553, 551, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 555, 1, 0, 0, 0, 555, 557, 5, 46, 0, 0, 556, 558, 3, 133, 66, 0, 557, 556, 1, 0, 0, 0, 558, 559, 1, 0, 0, 0, 559, 557, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 132, 1, 0, 0, 0, 561, 562, 7, 6, 0, 0, 562, 134, 1, 0, 0, 0, 563, 564, 7, 7, 0, 0, 564, 136, 1, 0, 0, 0, 565, 566, 5, 92, 0, 0, 566, 570, 7, 8, 0, 0, 567, 570, 3, 141, 70, 0, 568, 570, 3, 139, 69, 0, 569, 565, 1, 0, 0, 0, 569, 567, 1, 0, 0, 0, 569, 568, 1, 0, 0, 0, 570, 138, 1, 0, 0, 0, 571, 572, 5, 92, 0, 0, 572, 573, 2, 48, 51, 0, 573, 574, 2, 48, 55, 0, 574, 581, 2, 48, 55, 0, 575, 576, 5, 92, 0, 0, 576, 577, 2, 48, 55, 0, 577, 581, 2, 48, 55, 0, 578, 579, 5, 92, 0, 0, 579, 581, 2, 48, 55, 0, 580, 571, 1, 0, 0, 0, 580, 575, 1, 0, 0, 0, 580, 578, 1, 0, 0, 0, 581, 140, 1, 0, 0, 0, 582, 583, 5, 92, 0, 0, 583, 584, 5, 117, 0, 0, 584, 585, 3, 135, 67, 0, 585, 586, 3, 135, 67, 0, 586, 587, 3, 135, 67, 0, 587, 588, 3, 135, 67, 0, 588, 142, 1, 0, 0, 0, 589, 595, 7, 9, 0, 0, 590, 594, 7, 10, 0, 0, 591, 592, 7, 11, 0, 0, 592, 594, 7, 12, 0, 0, 593, 590, 1, 0, 0, 0, 593, 591, 1, 0, 0, 0, 594, 597, 1, 0, 0, 0, 595, 593, 1, 0, 0, 0, 595, 596, 1, 0, 0, 0, 596, 144, 1, 0, 0, 0, 597, 595, 1, 0, 0, 0, 598, 604, 7, 13, 0, 0, 599, 603, 7, 14, 0, 0, 600, 601, 7, 11, 0, 0, 601, 603, 7, 15, 0, 0, 602, 599, 1, 0, 0, 0, 602, 600, 1, 0, 0, 0, 603, 606, 1, 0, 0, 0, 604, 602, 1, 0, 0, 0, 604, 605, 1, 0, 0, 0, 605, 146, 1, 0, 0, 0, 606, 604, 1, 0, 0, 0, 607, 608, 5, 35, 0, 0, 608, 609, 3, 143, 71, 0, 609, 148, 1, 0, 0, 0, 610, 611, 5, 46, 0, 0, 611, 612, 3, 145, 72, 0, 612, 150, 1, 0, 0, 0, 613, 614, 5, 36, 0, 0, 614, 615, 3, 145, 72, 0, 615, 152, 1, 0, 0, 0, 616, 617, 5, 36, 0, 0, 617, 618, 5, 36, 0, 0, 618, 619, 1, 0, 0, 0, 619, 620, 3, 145, 72, 0, 620, 154, 1, 0, 0, 0, 621, 622, 5, 58, 0, 0, 622, 623, 3, 145, 72, 0, 623, 156, 1, 0, 0, 0, 624, 625, 5, 37, 0, 0, 625, 626, 3, 145, 72, 0, 626, 158, 1, 0, 0, 0, 627, 628, 3, 145, 72, 0, 628, 160, 1, 0, 0, 0, 26, 0, 163, 173, 179, 185, 191, 195, 206, 212, 505, 510, 514, 519, 521, 528, 530, 534, 548, 553, 559, 569, 580, 593, 595, 602, 604, 1, 6, 0, 0] \ No newline at end of file +[4, 0, 69, 627, 6, -1, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 2, 14, 7, 14, 2, 15, 7, 15, 2, 16, 7, 16, 2, 17, 7, 17, 2, 18, 7, 18, 2, 19, 7, 19, 2, 20, 7, 20, 2, 21, 7, 21, 2, 22, 7, 22, 2, 23, 7, 23, 2, 24, 7, 24, 2, 25, 7, 25, 2, 26, 7, 26, 2, 27, 7, 27, 2, 28, 7, 28, 2, 29, 7, 29, 2, 30, 7, 30, 2, 31, 7, 31, 2, 32, 7, 32, 2, 33, 7, 33, 2, 34, 7, 34, 2, 35, 7, 35, 2, 36, 7, 36, 2, 37, 7, 37, 2, 38, 7, 38, 2, 39, 7, 39, 2, 40, 7, 40, 2, 41, 7, 41, 2, 42, 7, 42, 2, 43, 7, 43, 2, 44, 7, 44, 2, 45, 7, 45, 2, 46, 7, 46, 2, 47, 7, 47, 2, 48, 7, 48, 2, 49, 7, 49, 2, 50, 7, 50, 2, 51, 7, 51, 2, 52, 7, 52, 2, 53, 7, 53, 2, 54, 7, 54, 2, 55, 7, 55, 2, 56, 7, 56, 2, 57, 7, 57, 2, 58, 7, 58, 2, 59, 7, 59, 2, 60, 7, 60, 2, 61, 7, 61, 2, 62, 7, 62, 2, 63, 7, 63, 2, 64, 7, 64, 2, 65, 7, 65, 2, 66, 7, 66, 2, 67, 7, 67, 2, 68, 7, 68, 2, 69, 7, 69, 2, 70, 7, 70, 2, 71, 7, 71, 2, 72, 7, 72, 2, 73, 7, 73, 2, 74, 7, 74, 2, 75, 7, 75, 2, 76, 7, 76, 2, 77, 7, 77, 2, 78, 7, 78, 2, 79, 7, 79, 1, 0, 1, 0, 3, 0, 164, 8, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 5, 1, 172, 8, 1, 10, 1, 12, 1, 175, 9, 1, 1, 1, 4, 1, 178, 8, 1, 11, 1, 12, 1, 179, 1, 1, 1, 1, 5, 1, 184, 8, 1, 10, 1, 12, 1, 187, 9, 1, 1, 1, 4, 1, 190, 8, 1, 11, 1, 12, 1, 191, 5, 1, 194, 8, 1, 10, 1, 12, 1, 197, 9, 1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 2, 1, 2, 5, 2, 205, 8, 2, 10, 2, 12, 2, 208, 9, 2, 1, 3, 4, 3, 211, 8, 3, 11, 3, 12, 3, 212, 1, 3, 1, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 11, 1, 11, 1, 12, 1, 12, 1, 12, 1, 12, 1, 12, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 13, 1, 14, 1, 14, 1, 14, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 15, 1, 16, 1, 16, 1, 16, 1, 17, 1, 17, 1, 17, 1, 17, 1, 17, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 18, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 19, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 20, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 21, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 22, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 23, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 24, 1, 25, 1, 25, 1, 25, 1, 25, 1, 25, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 26, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 27, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 28, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 29, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 30, 1, 31, 1, 31, 1, 32, 1, 32, 1, 33, 1, 33, 1, 34, 1, 34, 1, 35, 1, 35, 1, 36, 1, 36, 1, 37, 1, 37, 1, 38, 1, 38, 1, 39, 1, 39, 1, 40, 1, 40, 1, 41, 1, 41, 1, 42, 1, 42, 1, 43, 1, 43, 1, 44, 1, 44, 1, 45, 1, 45, 1, 45, 1, 45, 1, 46, 1, 46, 1, 47, 1, 47, 1, 47, 1, 48, 1, 48, 1, 49, 1, 49, 1, 49, 1, 50, 1, 50, 1, 50, 1, 51, 1, 51, 1, 51, 1, 52, 1, 52, 1, 52, 1, 52, 1, 53, 1, 53, 1, 53, 1, 54, 1, 54, 1, 54, 1, 55, 1, 55, 1, 55, 1, 55, 1, 55, 1, 56, 1, 56, 1, 57, 1, 57, 1, 57, 1, 57, 1, 57, 1, 58, 1, 58, 1, 58, 1, 58, 1, 58, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 59, 1, 60, 1, 60, 1, 60, 1, 60, 4, 60, 504, 8, 60, 11, 60, 12, 60, 505, 1, 61, 4, 61, 509, 8, 61, 11, 61, 12, 61, 510, 1, 61, 1, 61, 3, 61, 515, 8, 61, 1, 62, 1, 62, 1, 62, 5, 62, 520, 8, 62, 10, 62, 12, 62, 523, 9, 62, 1, 62, 1, 62, 1, 62, 1, 62, 5, 62, 529, 8, 62, 10, 62, 12, 62, 532, 9, 62, 1, 62, 3, 62, 535, 8, 62, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 63, 1, 64, 1, 64, 4, 64, 547, 8, 64, 11, 64, 12, 64, 548, 1, 65, 4, 65, 552, 8, 65, 11, 65, 12, 65, 553, 1, 65, 1, 65, 4, 65, 558, 8, 65, 11, 65, 12, 65, 559, 1, 66, 1, 66, 1, 67, 1, 67, 1, 68, 1, 68, 1, 68, 1, 68, 3, 68, 570, 8, 68, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 1, 69, 3, 69, 581, 8, 69, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 70, 1, 71, 1, 71, 5, 71, 592, 8, 71, 10, 71, 12, 71, 595, 9, 71, 1, 72, 1, 72, 1, 72, 1, 72, 5, 72, 601, 8, 72, 10, 72, 12, 72, 604, 9, 72, 1, 73, 1, 73, 1, 73, 1, 74, 1, 74, 1, 74, 1, 75, 1, 75, 1, 75, 1, 76, 1, 76, 1, 76, 1, 76, 1, 76, 1, 77, 1, 77, 1, 77, 1, 78, 1, 78, 1, 78, 1, 79, 1, 79, 0, 0, 80, 1, 1, 3, 0, 5, 0, 7, 2, 9, 3, 11, 4, 13, 5, 15, 6, 17, 7, 19, 8, 21, 9, 23, 10, 25, 11, 27, 12, 29, 13, 31, 14, 33, 15, 35, 16, 37, 17, 39, 18, 41, 19, 43, 20, 45, 21, 47, 22, 49, 23, 51, 24, 53, 25, 55, 26, 57, 27, 59, 28, 61, 29, 63, 30, 65, 31, 67, 32, 69, 33, 71, 34, 73, 35, 75, 36, 77, 37, 79, 38, 81, 39, 83, 40, 85, 41, 87, 42, 89, 43, 91, 44, 93, 45, 95, 46, 97, 47, 99, 48, 101, 49, 103, 50, 105, 51, 107, 52, 109, 53, 111, 54, 113, 55, 115, 56, 117, 57, 119, 58, 121, 59, 123, 60, 125, 61, 127, 62, 129, 0, 131, 0, 133, 0, 135, 0, 137, 0, 139, 0, 141, 0, 143, 0, 145, 0, 147, 63, 149, 64, 151, 65, 153, 66, 155, 67, 157, 68, 159, 69, 1, 0, 15, 1, 0, 42, 42, 2, 0, 42, 42, 47, 47, 2, 0, 10, 10, 13, 13, 3, 0, 9, 10, 12, 13, 32, 32, 2, 0, 34, 34, 92, 92, 2, 0, 39, 39, 92, 92, 1, 0, 48, 57, 3, 0, 48, 57, 65, 70, 97, 102, 8, 0, 34, 34, 39, 39, 92, 92, 98, 98, 102, 102, 110, 110, 114, 114, 116, 116, 6, 0, 42, 42, 48, 57, 63, 63, 65, 90, 95, 95, 97, 122, 7, 0, 42, 42, 45, 46, 48, 57, 63, 63, 65, 90, 95, 95, 97, 122, 3, 0, 65, 90, 95, 95, 97, 122, 5, 0, 46, 46, 48, 57, 65, 90, 95, 95, 97, 122, 1, 0, 45, 45, 2, 0, 65, 90, 97, 122, 642, 0, 1, 1, 0, 0, 0, 0, 7, 1, 0, 0, 0, 0, 9, 1, 0, 0, 0, 0, 11, 1, 0, 0, 0, 0, 13, 1, 0, 0, 0, 0, 15, 1, 0, 0, 0, 0, 17, 1, 0, 0, 0, 0, 19, 1, 0, 0, 0, 0, 21, 1, 0, 0, 0, 0, 23, 1, 0, 0, 0, 0, 25, 1, 0, 0, 0, 0, 27, 1, 0, 0, 0, 0, 29, 1, 0, 0, 0, 0, 31, 1, 0, 0, 0, 0, 33, 1, 0, 0, 0, 0, 35, 1, 0, 0, 0, 0, 37, 1, 0, 0, 0, 0, 39, 1, 0, 0, 0, 0, 41, 1, 0, 0, 0, 0, 43, 1, 0, 0, 0, 0, 45, 1, 0, 0, 0, 0, 47, 1, 0, 0, 0, 0, 49, 1, 0, 0, 0, 0, 51, 1, 0, 0, 0, 0, 53, 1, 0, 0, 0, 0, 55, 1, 0, 0, 0, 0, 57, 1, 0, 0, 0, 0, 59, 1, 0, 0, 0, 0, 61, 1, 0, 0, 0, 0, 63, 1, 0, 0, 0, 0, 65, 1, 0, 0, 0, 0, 67, 1, 0, 0, 0, 0, 69, 1, 0, 0, 0, 0, 71, 1, 0, 0, 0, 0, 73, 1, 0, 0, 0, 0, 75, 1, 0, 0, 0, 0, 77, 1, 0, 0, 0, 0, 79, 1, 0, 0, 0, 0, 81, 1, 0, 0, 0, 0, 83, 1, 0, 0, 0, 0, 85, 1, 0, 0, 0, 0, 87, 1, 0, 0, 0, 0, 89, 1, 0, 0, 0, 0, 91, 1, 0, 0, 0, 0, 93, 1, 0, 0, 0, 0, 95, 1, 0, 0, 0, 0, 97, 1, 0, 0, 0, 0, 99, 1, 0, 0, 0, 0, 101, 1, 0, 0, 0, 0, 103, 1, 0, 0, 0, 0, 105, 1, 0, 0, 0, 0, 107, 1, 0, 0, 0, 0, 109, 1, 0, 0, 0, 0, 111, 1, 0, 0, 0, 0, 113, 1, 0, 0, 0, 0, 115, 1, 0, 0, 0, 0, 117, 1, 0, 0, 0, 0, 119, 1, 0, 0, 0, 0, 121, 1, 0, 0, 0, 0, 123, 1, 0, 0, 0, 0, 125, 1, 0, 0, 0, 0, 127, 1, 0, 0, 0, 0, 147, 1, 0, 0, 0, 0, 149, 1, 0, 0, 0, 0, 151, 1, 0, 0, 0, 0, 153, 1, 0, 0, 0, 0, 155, 1, 0, 0, 0, 0, 157, 1, 0, 0, 0, 0, 159, 1, 0, 0, 0, 1, 163, 1, 0, 0, 0, 3, 167, 1, 0, 0, 0, 5, 200, 1, 0, 0, 0, 7, 210, 1, 0, 0, 0, 9, 216, 1, 0, 0, 0, 11, 221, 1, 0, 0, 0, 13, 231, 1, 0, 0, 0, 15, 235, 1, 0, 0, 0, 17, 241, 1, 0, 0, 0, 19, 250, 1, 0, 0, 0, 21, 257, 1, 0, 0, 0, 23, 264, 1, 0, 0, 0, 25, 269, 1, 0, 0, 0, 27, 274, 1, 0, 0, 0, 29, 282, 1, 0, 0, 0, 31, 285, 1, 0, 0, 0, 33, 291, 1, 0, 0, 0, 35, 294, 1, 0, 0, 0, 37, 299, 1, 0, 0, 0, 39, 306, 1, 0, 0, 0, 41, 315, 1, 0, 0, 0, 43, 322, 1, 0, 0, 0, 45, 336, 1, 0, 0, 0, 47, 345, 1, 0, 0, 0, 49, 353, 1, 0, 0, 0, 51, 360, 1, 0, 0, 0, 53, 365, 1, 0, 0, 0, 55, 373, 1, 0, 0, 0, 57, 380, 1, 0, 0, 0, 59, 388, 1, 0, 0, 0, 61, 403, 1, 0, 0, 0, 63, 418, 1, 0, 0, 0, 65, 420, 1, 0, 0, 0, 67, 422, 1, 0, 0, 0, 69, 424, 1, 0, 0, 0, 71, 426, 1, 0, 0, 0, 73, 428, 1, 0, 0, 0, 75, 430, 1, 0, 0, 0, 77, 432, 1, 0, 0, 0, 79, 434, 1, 0, 0, 0, 81, 436, 1, 0, 0, 0, 83, 438, 1, 0, 0, 0, 85, 440, 1, 0, 0, 0, 87, 442, 1, 0, 0, 0, 89, 444, 1, 0, 0, 0, 91, 446, 1, 0, 0, 0, 93, 450, 1, 0, 0, 0, 95, 452, 1, 0, 0, 0, 97, 455, 1, 0, 0, 0, 99, 457, 1, 0, 0, 0, 101, 460, 1, 0, 0, 0, 103, 463, 1, 0, 0, 0, 105, 466, 1, 0, 0, 0, 107, 470, 1, 0, 0, 0, 109, 473, 1, 0, 0, 0, 111, 476, 1, 0, 0, 0, 113, 481, 1, 0, 0, 0, 115, 483, 1, 0, 0, 0, 117, 488, 1, 0, 0, 0, 119, 493, 1, 0, 0, 0, 121, 499, 1, 0, 0, 0, 123, 514, 1, 0, 0, 0, 125, 534, 1, 0, 0, 0, 127, 536, 1, 0, 0, 0, 129, 544, 1, 0, 0, 0, 131, 551, 1, 0, 0, 0, 133, 561, 1, 0, 0, 0, 135, 563, 1, 0, 0, 0, 137, 569, 1, 0, 0, 0, 139, 580, 1, 0, 0, 0, 141, 582, 1, 0, 0, 0, 143, 589, 1, 0, 0, 0, 145, 596, 1, 0, 0, 0, 147, 605, 1, 0, 0, 0, 149, 608, 1, 0, 0, 0, 151, 611, 1, 0, 0, 0, 153, 614, 1, 0, 0, 0, 155, 619, 1, 0, 0, 0, 157, 622, 1, 0, 0, 0, 159, 625, 1, 0, 0, 0, 161, 164, 3, 5, 2, 0, 162, 164, 3, 3, 1, 0, 163, 161, 1, 0, 0, 0, 163, 162, 1, 0, 0, 0, 164, 165, 1, 0, 0, 0, 165, 166, 6, 0, 0, 0, 166, 2, 1, 0, 0, 0, 167, 168, 5, 47, 0, 0, 168, 169, 5, 42, 0, 0, 169, 173, 1, 0, 0, 0, 170, 172, 8, 0, 0, 0, 171, 170, 1, 0, 0, 0, 172, 175, 1, 0, 0, 0, 173, 171, 1, 0, 0, 0, 173, 174, 1, 0, 0, 0, 174, 177, 1, 0, 0, 0, 175, 173, 1, 0, 0, 0, 176, 178, 5, 42, 0, 0, 177, 176, 1, 0, 0, 0, 178, 179, 1, 0, 0, 0, 179, 177, 1, 0, 0, 0, 179, 180, 1, 0, 0, 0, 180, 195, 1, 0, 0, 0, 181, 185, 8, 1, 0, 0, 182, 184, 8, 0, 0, 0, 183, 182, 1, 0, 0, 0, 184, 187, 1, 0, 0, 0, 185, 183, 1, 0, 0, 0, 185, 186, 1, 0, 0, 0, 186, 189, 1, 0, 0, 0, 187, 185, 1, 0, 0, 0, 188, 190, 5, 42, 0, 0, 189, 188, 1, 0, 0, 0, 190, 191, 1, 0, 0, 0, 191, 189, 1, 0, 0, 0, 191, 192, 1, 0, 0, 0, 192, 194, 1, 0, 0, 0, 193, 181, 1, 0, 0, 0, 194, 197, 1, 0, 0, 0, 195, 193, 1, 0, 0, 0, 195, 196, 1, 0, 0, 0, 196, 198, 1, 0, 0, 0, 197, 195, 1, 0, 0, 0, 198, 199, 5, 47, 0, 0, 199, 4, 1, 0, 0, 0, 200, 201, 5, 47, 0, 0, 201, 202, 5, 47, 0, 0, 202, 206, 1, 0, 0, 0, 203, 205, 8, 2, 0, 0, 204, 203, 1, 0, 0, 0, 205, 208, 1, 0, 0, 0, 206, 204, 1, 0, 0, 0, 206, 207, 1, 0, 0, 0, 207, 6, 1, 0, 0, 0, 208, 206, 1, 0, 0, 0, 209, 211, 7, 3, 0, 0, 210, 209, 1, 0, 0, 0, 211, 212, 1, 0, 0, 0, 212, 210, 1, 0, 0, 0, 212, 213, 1, 0, 0, 0, 213, 214, 1, 0, 0, 0, 214, 215, 6, 3, 0, 0, 215, 8, 1, 0, 0, 0, 216, 217, 5, 64, 0, 0, 217, 218, 5, 117, 0, 0, 218, 219, 5, 115, 0, 0, 219, 220, 5, 101, 0, 0, 220, 10, 1, 0, 0, 0, 221, 222, 5, 64, 0, 0, 222, 223, 5, 102, 0, 0, 223, 224, 5, 117, 0, 0, 224, 225, 5, 110, 0, 0, 225, 226, 5, 99, 0, 0, 226, 227, 5, 116, 0, 0, 227, 228, 5, 105, 0, 0, 228, 229, 5, 111, 0, 0, 229, 230, 5, 110, 0, 0, 230, 12, 1, 0, 0, 0, 231, 232, 5, 64, 0, 0, 232, 233, 5, 105, 0, 0, 233, 234, 5, 102, 0, 0, 234, 14, 1, 0, 0, 0, 235, 236, 5, 64, 0, 0, 236, 237, 5, 101, 0, 0, 237, 238, 5, 108, 0, 0, 238, 239, 5, 115, 0, 0, 239, 240, 5, 101, 0, 0, 240, 16, 1, 0, 0, 0, 241, 242, 5, 64, 0, 0, 242, 243, 5, 101, 0, 0, 243, 244, 5, 108, 0, 0, 244, 245, 5, 115, 0, 0, 245, 246, 5, 101, 0, 0, 246, 247, 5, 45, 0, 0, 247, 248, 5, 105, 0, 0, 248, 249, 5, 102, 0, 0, 249, 18, 1, 0, 0, 0, 250, 251, 5, 64, 0, 0, 251, 252, 5, 109, 0, 0, 252, 253, 5, 105, 0, 0, 253, 254, 5, 120, 0, 0, 254, 255, 5, 105, 0, 0, 255, 256, 5, 110, 0, 0, 256, 20, 1, 0, 0, 0, 257, 258, 5, 64, 0, 0, 258, 259, 5, 119, 0, 0, 259, 260, 5, 104, 0, 0, 260, 261, 5, 105, 0, 0, 261, 262, 5, 108, 0, 0, 262, 263, 5, 101, 0, 0, 263, 22, 1, 0, 0, 0, 264, 265, 5, 64, 0, 0, 265, 266, 5, 102, 0, 0, 266, 267, 5, 111, 0, 0, 267, 268, 5, 114, 0, 0, 268, 24, 1, 0, 0, 0, 269, 270, 5, 102, 0, 0, 270, 271, 5, 114, 0, 0, 271, 272, 5, 111, 0, 0, 272, 273, 5, 109, 0, 0, 273, 26, 1, 0, 0, 0, 274, 275, 5, 116, 0, 0, 275, 276, 5, 104, 0, 0, 276, 277, 5, 114, 0, 0, 277, 278, 5, 111, 0, 0, 278, 279, 5, 117, 0, 0, 279, 280, 5, 103, 0, 0, 280, 281, 5, 104, 0, 0, 281, 28, 1, 0, 0, 0, 282, 283, 5, 116, 0, 0, 283, 284, 5, 111, 0, 0, 284, 30, 1, 0, 0, 0, 285, 286, 5, 64, 0, 0, 286, 287, 5, 101, 0, 0, 287, 288, 5, 97, 0, 0, 288, 289, 5, 99, 0, 0, 289, 290, 5, 104, 0, 0, 290, 32, 1, 0, 0, 0, 291, 292, 5, 105, 0, 0, 292, 293, 5, 110, 0, 0, 293, 34, 1, 0, 0, 0, 294, 295, 5, 64, 0, 0, 295, 296, 5, 115, 0, 0, 296, 297, 5, 101, 0, 0, 297, 298, 5, 116, 0, 0, 298, 36, 1, 0, 0, 0, 299, 300, 5, 64, 0, 0, 300, 301, 5, 109, 0, 0, 301, 302, 5, 101, 0, 0, 302, 303, 5, 114, 0, 0, 303, 304, 5, 103, 0, 0, 304, 305, 5, 101, 0, 0, 305, 38, 1, 0, 0, 0, 306, 307, 5, 64, 0, 0, 307, 308, 5, 114, 0, 0, 308, 309, 5, 101, 0, 0, 309, 310, 5, 113, 0, 0, 310, 311, 5, 117, 0, 0, 311, 312, 5, 105, 0, 0, 312, 313, 5, 114, 0, 0, 313, 314, 5, 101, 0, 0, 314, 40, 1, 0, 0, 0, 315, 316, 5, 64, 0, 0, 316, 317, 5, 115, 0, 0, 317, 318, 5, 116, 0, 0, 318, 319, 5, 97, 0, 0, 319, 320, 5, 103, 0, 0, 320, 321, 5, 101, 0, 0, 321, 42, 1, 0, 0, 0, 322, 323, 5, 64, 0, 0, 323, 324, 5, 100, 0, 0, 324, 325, 5, 101, 0, 0, 325, 326, 5, 102, 0, 0, 326, 327, 5, 105, 0, 0, 327, 328, 5, 110, 0, 0, 328, 329, 5, 101, 0, 0, 329, 330, 5, 45, 0, 0, 330, 331, 5, 115, 0, 0, 331, 332, 5, 116, 0, 0, 332, 333, 5, 97, 0, 0, 333, 334, 5, 103, 0, 0, 334, 335, 5, 101, 0, 0, 335, 44, 1, 0, 0, 0, 336, 337, 5, 64, 0, 0, 337, 338, 5, 105, 0, 0, 338, 339, 5, 110, 0, 0, 339, 340, 5, 99, 0, 0, 340, 341, 5, 108, 0, 0, 341, 342, 5, 117, 0, 0, 342, 343, 5, 100, 0, 0, 343, 344, 5, 101, 0, 0, 344, 46, 1, 0, 0, 0, 345, 346, 5, 64, 0, 0, 346, 347, 5, 114, 0, 0, 347, 348, 5, 101, 0, 0, 348, 349, 5, 116, 0, 0, 349, 350, 5, 117, 0, 0, 350, 351, 5, 114, 0, 0, 351, 352, 5, 110, 0, 0, 352, 48, 1, 0, 0, 0, 353, 354, 5, 64, 0, 0, 354, 355, 5, 112, 0, 0, 355, 356, 5, 97, 0, 0, 356, 357, 5, 116, 0, 0, 357, 358, 5, 99, 0, 0, 358, 359, 5, 104, 0, 0, 359, 50, 1, 0, 0, 0, 360, 361, 5, 64, 0, 0, 361, 362, 5, 110, 0, 0, 362, 363, 5, 101, 0, 0, 363, 364, 5, 119, 0, 0, 364, 52, 1, 0, 0, 0, 365, 366, 5, 64, 0, 0, 366, 367, 5, 98, 0, 0, 367, 368, 5, 101, 0, 0, 368, 369, 5, 102, 0, 0, 369, 370, 5, 111, 0, 0, 370, 371, 5, 114, 0, 0, 371, 372, 5, 101, 0, 0, 372, 54, 1, 0, 0, 0, 373, 374, 5, 64, 0, 0, 374, 375, 5, 97, 0, 0, 375, 376, 5, 102, 0, 0, 376, 377, 5, 116, 0, 0, 377, 378, 5, 101, 0, 0, 378, 379, 5, 114, 0, 0, 379, 56, 1, 0, 0, 0, 380, 381, 5, 64, 0, 0, 381, 382, 5, 103, 0, 0, 382, 383, 5, 108, 0, 0, 383, 384, 5, 111, 0, 0, 384, 385, 5, 98, 0, 0, 385, 386, 5, 97, 0, 0, 386, 387, 5, 108, 0, 0, 387, 58, 1, 0, 0, 0, 388, 389, 5, 64, 0, 0, 389, 390, 5, 99, 0, 0, 390, 391, 5, 114, 0, 0, 391, 392, 5, 101, 0, 0, 392, 393, 5, 97, 0, 0, 393, 394, 5, 116, 0, 0, 394, 395, 5, 101, 0, 0, 395, 396, 5, 45, 0, 0, 396, 397, 5, 99, 0, 0, 397, 398, 5, 111, 0, 0, 398, 399, 5, 110, 0, 0, 399, 400, 5, 102, 0, 0, 400, 401, 5, 105, 0, 0, 401, 402, 5, 103, 0, 0, 402, 60, 1, 0, 0, 0, 403, 404, 5, 64, 0, 0, 404, 405, 5, 117, 0, 0, 405, 406, 5, 112, 0, 0, 406, 407, 5, 100, 0, 0, 407, 408, 5, 97, 0, 0, 408, 409, 5, 116, 0, 0, 409, 410, 5, 101, 0, 0, 410, 411, 5, 45, 0, 0, 411, 412, 5, 99, 0, 0, 412, 413, 5, 111, 0, 0, 413, 414, 5, 110, 0, 0, 414, 415, 5, 102, 0, 0, 415, 416, 5, 105, 0, 0, 416, 417, 5, 103, 0, 0, 417, 62, 1, 0, 0, 0, 418, 419, 5, 123, 0, 0, 419, 64, 1, 0, 0, 0, 420, 421, 5, 125, 0, 0, 421, 66, 1, 0, 0, 0, 422, 423, 5, 40, 0, 0, 423, 68, 1, 0, 0, 0, 424, 425, 5, 41, 0, 0, 425, 70, 1, 0, 0, 0, 426, 427, 5, 91, 0, 0, 427, 72, 1, 0, 0, 0, 428, 429, 5, 93, 0, 0, 429, 74, 1, 0, 0, 0, 430, 431, 5, 59, 0, 0, 431, 76, 1, 0, 0, 0, 432, 433, 5, 58, 0, 0, 433, 78, 1, 0, 0, 0, 434, 435, 5, 44, 0, 0, 435, 80, 1, 0, 0, 0, 436, 437, 5, 43, 0, 0, 437, 82, 1, 0, 0, 0, 438, 439, 5, 45, 0, 0, 439, 84, 1, 0, 0, 0, 440, 441, 5, 42, 0, 0, 441, 86, 1, 0, 0, 0, 442, 443, 5, 47, 0, 0, 443, 88, 1, 0, 0, 0, 444, 445, 5, 37, 0, 0, 445, 90, 1, 0, 0, 0, 446, 447, 5, 110, 0, 0, 447, 448, 5, 111, 0, 0, 448, 449, 5, 116, 0, 0, 449, 92, 1, 0, 0, 0, 450, 451, 5, 62, 0, 0, 451, 94, 1, 0, 0, 0, 452, 453, 5, 62, 0, 0, 453, 454, 5, 61, 0, 0, 454, 96, 1, 0, 0, 0, 455, 456, 5, 60, 0, 0, 456, 98, 1, 0, 0, 0, 457, 458, 5, 60, 0, 0, 458, 459, 5, 61, 0, 0, 459, 100, 1, 0, 0, 0, 460, 461, 5, 61, 0, 0, 461, 462, 5, 61, 0, 0, 462, 102, 1, 0, 0, 0, 463, 464, 5, 33, 0, 0, 464, 465, 5, 61, 0, 0, 465, 104, 1, 0, 0, 0, 466, 467, 5, 97, 0, 0, 467, 468, 5, 110, 0, 0, 468, 469, 5, 100, 0, 0, 469, 106, 1, 0, 0, 0, 470, 471, 5, 111, 0, 0, 471, 472, 5, 114, 0, 0, 472, 108, 1, 0, 0, 0, 473, 474, 5, 105, 0, 0, 474, 475, 5, 102, 0, 0, 475, 110, 1, 0, 0, 0, 476, 477, 5, 101, 0, 0, 477, 478, 5, 108, 0, 0, 478, 479, 5, 115, 0, 0, 479, 480, 5, 101, 0, 0, 480, 112, 1, 0, 0, 0, 481, 482, 5, 126, 0, 0, 482, 114, 1, 0, 0, 0, 483, 484, 5, 110, 0, 0, 484, 485, 5, 117, 0, 0, 485, 486, 5, 108, 0, 0, 486, 487, 5, 108, 0, 0, 487, 116, 1, 0, 0, 0, 488, 489, 5, 116, 0, 0, 489, 490, 5, 114, 0, 0, 490, 491, 5, 117, 0, 0, 491, 492, 5, 101, 0, 0, 492, 118, 1, 0, 0, 0, 493, 494, 5, 102, 0, 0, 494, 495, 5, 97, 0, 0, 495, 496, 5, 108, 0, 0, 496, 497, 5, 115, 0, 0, 497, 498, 5, 101, 0, 0, 498, 120, 1, 0, 0, 0, 499, 500, 5, 48, 0, 0, 500, 501, 5, 120, 0, 0, 501, 503, 1, 0, 0, 0, 502, 504, 3, 135, 67, 0, 503, 502, 1, 0, 0, 0, 504, 505, 1, 0, 0, 0, 505, 503, 1, 0, 0, 0, 505, 506, 1, 0, 0, 0, 506, 122, 1, 0, 0, 0, 507, 509, 3, 133, 66, 0, 508, 507, 1, 0, 0, 0, 509, 510, 1, 0, 0, 0, 510, 508, 1, 0, 0, 0, 510, 511, 1, 0, 0, 0, 511, 515, 1, 0, 0, 0, 512, 515, 3, 129, 64, 0, 513, 515, 3, 131, 65, 0, 514, 508, 1, 0, 0, 0, 514, 512, 1, 0, 0, 0, 514, 513, 1, 0, 0, 0, 515, 124, 1, 0, 0, 0, 516, 521, 5, 34, 0, 0, 517, 520, 3, 137, 68, 0, 518, 520, 8, 4, 0, 0, 519, 517, 1, 0, 0, 0, 519, 518, 1, 0, 0, 0, 520, 523, 1, 0, 0, 0, 521, 519, 1, 0, 0, 0, 521, 522, 1, 0, 0, 0, 522, 524, 1, 0, 0, 0, 523, 521, 1, 0, 0, 0, 524, 535, 5, 34, 0, 0, 525, 530, 5, 39, 0, 0, 526, 529, 3, 137, 68, 0, 527, 529, 8, 5, 0, 0, 528, 526, 1, 0, 0, 0, 528, 527, 1, 0, 0, 0, 529, 532, 1, 0, 0, 0, 530, 528, 1, 0, 0, 0, 530, 531, 1, 0, 0, 0, 531, 533, 1, 0, 0, 0, 532, 530, 1, 0, 0, 0, 533, 535, 5, 39, 0, 0, 534, 516, 1, 0, 0, 0, 534, 525, 1, 0, 0, 0, 535, 126, 1, 0, 0, 0, 536, 537, 5, 64, 0, 0, 537, 538, 5, 100, 0, 0, 538, 539, 5, 101, 0, 0, 539, 540, 5, 108, 0, 0, 540, 541, 5, 101, 0, 0, 541, 542, 5, 116, 0, 0, 542, 543, 5, 101, 0, 0, 543, 128, 1, 0, 0, 0, 544, 546, 5, 46, 0, 0, 545, 547, 3, 133, 66, 0, 546, 545, 1, 0, 0, 0, 547, 548, 1, 0, 0, 0, 548, 546, 1, 0, 0, 0, 548, 549, 1, 0, 0, 0, 549, 130, 1, 0, 0, 0, 550, 552, 3, 133, 66, 0, 551, 550, 1, 0, 0, 0, 552, 553, 1, 0, 0, 0, 553, 551, 1, 0, 0, 0, 553, 554, 1, 0, 0, 0, 554, 555, 1, 0, 0, 0, 555, 557, 5, 46, 0, 0, 556, 558, 3, 133, 66, 0, 557, 556, 1, 0, 0, 0, 558, 559, 1, 0, 0, 0, 559, 557, 1, 0, 0, 0, 559, 560, 1, 0, 0, 0, 560, 132, 1, 0, 0, 0, 561, 562, 7, 6, 0, 0, 562, 134, 1, 0, 0, 0, 563, 564, 7, 7, 0, 0, 564, 136, 1, 0, 0, 0, 565, 566, 5, 92, 0, 0, 566, 570, 7, 8, 0, 0, 567, 570, 3, 141, 70, 0, 568, 570, 3, 139, 69, 0, 569, 565, 1, 0, 0, 0, 569, 567, 1, 0, 0, 0, 569, 568, 1, 0, 0, 0, 570, 138, 1, 0, 0, 0, 571, 572, 5, 92, 0, 0, 572, 573, 2, 48, 51, 0, 573, 574, 2, 48, 55, 0, 574, 581, 2, 48, 55, 0, 575, 576, 5, 92, 0, 0, 576, 577, 2, 48, 55, 0, 577, 581, 2, 48, 55, 0, 578, 579, 5, 92, 0, 0, 579, 581, 2, 48, 55, 0, 580, 571, 1, 0, 0, 0, 580, 575, 1, 0, 0, 0, 580, 578, 1, 0, 0, 0, 581, 140, 1, 0, 0, 0, 582, 583, 5, 92, 0, 0, 583, 584, 5, 117, 0, 0, 584, 585, 3, 135, 67, 0, 585, 586, 3, 135, 67, 0, 586, 587, 3, 135, 67, 0, 587, 588, 3, 135, 67, 0, 588, 142, 1, 0, 0, 0, 589, 593, 7, 9, 0, 0, 590, 592, 7, 10, 0, 0, 591, 590, 1, 0, 0, 0, 592, 595, 1, 0, 0, 0, 593, 591, 1, 0, 0, 0, 593, 594, 1, 0, 0, 0, 594, 144, 1, 0, 0, 0, 595, 593, 1, 0, 0, 0, 596, 602, 7, 11, 0, 0, 597, 601, 7, 12, 0, 0, 598, 599, 7, 13, 0, 0, 599, 601, 7, 14, 0, 0, 600, 597, 1, 0, 0, 0, 600, 598, 1, 0, 0, 0, 601, 604, 1, 0, 0, 0, 602, 600, 1, 0, 0, 0, 602, 603, 1, 0, 0, 0, 603, 146, 1, 0, 0, 0, 604, 602, 1, 0, 0, 0, 605, 606, 5, 35, 0, 0, 606, 607, 3, 143, 71, 0, 607, 148, 1, 0, 0, 0, 608, 609, 5, 46, 0, 0, 609, 610, 3, 145, 72, 0, 610, 150, 1, 0, 0, 0, 611, 612, 5, 36, 0, 0, 612, 613, 3, 145, 72, 0, 613, 152, 1, 0, 0, 0, 614, 615, 5, 36, 0, 0, 615, 616, 5, 36, 0, 0, 616, 617, 1, 0, 0, 0, 617, 618, 3, 145, 72, 0, 618, 154, 1, 0, 0, 0, 619, 620, 5, 58, 0, 0, 620, 621, 3, 145, 72, 0, 621, 156, 1, 0, 0, 0, 622, 623, 5, 37, 0, 0, 623, 624, 3, 145, 72, 0, 624, 158, 1, 0, 0, 0, 625, 626, 3, 145, 72, 0, 626, 160, 1, 0, 0, 0, 25, 0, 163, 173, 179, 185, 191, 195, 206, 212, 505, 510, 514, 519, 521, 528, 530, 534, 548, 553, 559, 569, 580, 593, 600, 602, 1, 6, 0, 0] \ No newline at end of file diff --git a/src/PatchManager.SassyPatching/Selectables/JTokenSelectable.cs b/src/PatchManager.SassyPatching/Selectables/JTokenSelectable.cs index 6754c4a..dd14f28 100644 --- a/src/PatchManager.SassyPatching/Selectables/JTokenSelectable.cs +++ b/src/PatchManager.SassyPatching/Selectables/JTokenSelectable.cs @@ -104,16 +104,19 @@ public override IModifiable OpenModification() public override ISelectable AddElement(string elementType) { var obj = new JObject(); - if (Token is JArray jArray) + var token = Token; + while (token is JProperty prop) + token = prop.Value; + switch (token) { - jArray[elementType] = obj; - } else if (Token is JObject jObject) - { - jObject[elementType] = obj; - } - else - { - throw new InvalidOperationException(); + case JArray jArray: + jArray.Add(obj); + break; + case JObject jObject: + jObject[elementType] = obj; + break; + default: + throw new InvalidOperationException(); } var n = new JTokenSelectable(_markDirty, obj, elementType); Children.Add(n); diff --git a/src/PatchManager.SassyPatching/Transformer.cs b/src/PatchManager.SassyPatching/Transformer.cs index 1863eed..7565bc0 100644 --- a/src/PatchManager.SassyPatching/Transformer.cs +++ b/src/PatchManager.SassyPatching/Transformer.cs @@ -272,7 +272,7 @@ public override Node VisitName(sassy_parser.NameContext context) /// public override Node VisitAdd_element(sassy_parser.Add_elementContext context) - => new ElementAdditionSelector(context.GetCoordinate(), context.ELEMENT().GetText().TrimFirst()); + => new ElementAdditionSelector(context.GetCoordinate(), context.ELEMENT().GetText()); /// public override Node VisitEverything(sassy_parser.EverythingContext context) diff --git a/src/PatchManager.Science/Modifiables/ExperimentModifiable.cs b/src/PatchManager.Science/Modifiables/ExperimentModifiable.cs new file mode 100644 index 0000000..f0f769b --- /dev/null +++ b/src/PatchManager.Science/Modifiables/ExperimentModifiable.cs @@ -0,0 +1,24 @@ +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Modifiables; +using PatchManager.Science.Selectables; + +namespace PatchManager.Science.Modifiables; + +public class ExperimentModifiable : JTokenModifiable +{ + private ExperimentSelectable _experimentSelectable; + + public ExperimentModifiable(ExperimentSelectable selectable) : base(selectable.DataObject, selectable.SetModified) + { + _experimentSelectable = selectable; + } + + public override void Set(DataValue dataValue) + { + if (dataValue.IsDeletion) + { + _experimentSelectable.SetDeleted(); + } + base.Set(dataValue); + } +} \ No newline at end of file diff --git a/src/PatchManager.Science/Modifiables/ScienceModifiable.cs b/src/PatchManager.Science/Modifiables/ScienceModifiable.cs new file mode 100644 index 0000000..ef84202 --- /dev/null +++ b/src/PatchManager.Science/Modifiables/ScienceModifiable.cs @@ -0,0 +1,25 @@ +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Modifiables; +using PatchManager.Science.Selectables; + +namespace PatchManager.Science.Modifiables; + +public class ScienceModifiable : JTokenModifiable +{ + private ScienceSelectable _scienceSelectable; + + public ScienceModifiable(ScienceSelectable selectable) : base(selectable.ScienceObject, selectable.SetModified) + { + _scienceSelectable = selectable; + } + + public override void Set(DataValue dataValue) + { + if (dataValue.IsDeletion) + { + _scienceSelectable.SetDeleted(); + } + base.Set(dataValue); + } +} \ No newline at end of file diff --git a/src/PatchManager.Science/PatchManager.Science.csproj b/src/PatchManager.Science/PatchManager.Science.csproj index 95ece53..f4fbf86 100644 --- a/src/PatchManager.Science/PatchManager.Science.csproj +++ b/src/PatchManager.Science/PatchManager.Science.csproj @@ -9,4 +9,8 @@ + + + + diff --git a/src/PatchManager.Science/Rulesets/ExperimentRuleset.cs b/src/PatchManager.Science/Rulesets/ExperimentRuleset.cs new file mode 100644 index 0000000..c27f27a --- /dev/null +++ b/src/PatchManager.Science/Rulesets/ExperimentRuleset.cs @@ -0,0 +1,32 @@ +using JetBrains.Annotations; +using KSP.Game.Science; +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Attributes; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.NewAssets; +using PatchManager.Science.Selectables; + +namespace PatchManager.Science.Rulesets; + +[PatcherRuleset("experiments","scienceExperiment"),UsedImplicitly] +public class ExperimentRuleset : IPatcherRuleSet +{ + public bool Matches(string label) => label == "scienceExperiment"; + + public ISelectable ConvertToSelectable(string type, string name, string jsonData) => + new ExperimentSelectable(JObject.Parse(jsonData)); + + public INewAsset CreateNew(List dataValues) + { + var core = new ExperimentCore + { + data = new ExperimentDefinition + { + ExperimentID = dataValues[0].String + } + }; + return new NewGenericAsset("scienceExperiment", dataValues[0].String, + new ExperimentSelectable(JObject.FromObject(core))); + } +} \ No newline at end of file diff --git a/src/PatchManager.Science/ScienceModule.cs b/src/PatchManager.Science/ScienceModule.cs new file mode 100644 index 0000000..90d0aa6 --- /dev/null +++ b/src/PatchManager.Science/ScienceModule.cs @@ -0,0 +1,11 @@ +using JetBrains.Annotations; +using PatchManager.Shared.Modules; + +namespace PatchManager.Science; + + +[UsedImplicitly] +public class ScienceModule : BaseModule +{ + +} \ No newline at end of file diff --git a/src/PatchManager.Science/Selectables/ExperimentSelectable.cs b/src/PatchManager.Science/Selectables/ExperimentSelectable.cs new file mode 100644 index 0000000..546de0a --- /dev/null +++ b/src/PatchManager.Science/Selectables/ExperimentSelectable.cs @@ -0,0 +1,96 @@ +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Selectables; +using PatchManager.Science.Modifiables; + +namespace PatchManager.Science.Selectables; + +public class ExperimentSelectable : BaseSelectable +{ + private bool _modified = false; + private bool _deleted = false; + + + /// + /// Marks this part selectable as having been modified any level down + /// + public void SetModified() + { + _modified = true; + } + + /// + /// Marks this part as goneso + /// + public void SetDeleted() + { + SetModified(); + _deleted = true; + } + + public JObject ScienceObject; + public JObject DataObject; + + public ExperimentSelectable(JObject scienceData) + { + ElementType = "scienceExperiment"; + ScienceObject = scienceData; + DataObject = (JObject)scienceData["data"]!; + Classes = new(); + Children = new(); + foreach (var subToken in DataObject) + { + Classes.Add(subToken.Key); + Children.Add(new JTokenSelectable(SetModified,subToken.Value,subToken.Key)); + } + } + /// + public sealed override List Children { get; } + + + /// + public override string Name => DataObject["ExperimentID"]!.Value()!; + + /// + public sealed override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + classValue = null; + if (!MatchesClass(@class)) + { + return false; + } + + classValue = DataValue.FromJToken(DataObject[@class]); + return true; + + } + + /// + public override string ElementType { get; } + + /// + public override bool IsSameAs(ISelectable other) => + other is ScienceSelectable selectable && selectable.ScienceObject == ScienceObject; + + /// + public override IModifiable OpenModification() => new ExperimentModifiable(this); + + /// + public override ISelectable AddElement(string elementType) + { + var obj = new JObject(); + DataObject[elementType] = obj; + var n = new JTokenSelectable(SetModified, obj, elementType); + Children.Add(n); + return n; + } + + /// + public override string Serialize() => _deleted ? "" : ScienceObject.ToString(); + + /// + public override DataValue GetValue() => DataValue.FromJToken(DataObject); +} \ No newline at end of file diff --git a/src/PatchManager.Science/Selectables/ScienceSelectable.cs b/src/PatchManager.Science/Selectables/ScienceSelectable.cs new file mode 100644 index 0000000..74f0c91 --- /dev/null +++ b/src/PatchManager.Science/Selectables/ScienceSelectable.cs @@ -0,0 +1,95 @@ +using Newtonsoft.Json.Linq; +using PatchManager.SassyPatching; +using PatchManager.SassyPatching.Interfaces; +using PatchManager.SassyPatching.Selectables; +using PatchManager.Science.Modifiables; + +namespace PatchManager.Science.Selectables; + +public sealed class ScienceSelectable : BaseSelectable +{ + + private bool _modified = false; + private bool _deleted = false; + + + /// + /// Marks this part selectable as having been modified any level down + /// + public void SetModified() + { + _modified = true; + } + + /// + /// Marks this part as goneso + /// + public void SetDeleted() + { + SetModified(); + _deleted = true; + } + + public JObject ScienceObject; + + public ScienceSelectable(JObject scienceData) + { + ElementType = "techNodeData"; + ScienceObject = scienceData; + Classes = new(); + Children = new(); + foreach (var subToken in ScienceObject) + { + Classes.Add(subToken.Key); + Children.Add(new JTokenSelectable(SetModified,subToken.Value,subToken.Key)); + } + } + /// + public sealed override List Children { get; } + + + /// + public override string Name => ScienceObject["ID"]!.Value()!; + + /// + public sealed override List Classes { get; } + + public override bool MatchesClass(string @class, out DataValue classValue) + { + classValue = null; + if (!MatchesClass(@class)) + { + return false; + } + + classValue = DataValue.FromJToken(ScienceObject[@class]); + return true; + + } + + /// + public override string ElementType { get; } + + /// + public override bool IsSameAs(ISelectable other) => + other is ScienceSelectable selectable && selectable.ScienceObject == ScienceObject; + + /// + public override IModifiable OpenModification() => new ScienceModifiable(this); + + /// + public override ISelectable AddElement(string elementType) + { + var obj = new JObject(); + ScienceObject[elementType] = obj; + var n = new JTokenSelectable(SetModified, obj, elementType); + Children.Add(n); + return n; + } + + /// + public override string Serialize() => _deleted ? "" : ScienceObject.ToString(); + + /// + public override DataValue GetValue() => DataValue.FromJToken(ScienceObject); +} \ No newline at end of file diff --git a/src/PatchManager/PatchManager.csproj b/src/PatchManager/PatchManager.csproj index 8f2c93f..70d079e 100644 --- a/src/PatchManager/PatchManager.csproj +++ b/src/PatchManager/PatchManager.csproj @@ -5,7 +5,7 @@ - + diff --git a/src/PatchManager/PatchManagerPlugin.cs b/src/PatchManager/PatchManagerPlugin.cs index 74a423d..2b9c315 100644 --- a/src/PatchManager/PatchManagerPlugin.cs +++ b/src/PatchManager/PatchManagerPlugin.cs @@ -47,6 +47,7 @@ private void Awake() ModuleManager.Register(Path.Combine(dir.FullName, "PatchManager.Generic.dll")); ModuleManager.Register(Path.Combine(dir.FullName, "PatchManager.Resources.dll")); ModuleManager.Register(Path.Combine(dir.FullName, "PatchManager.Science.dll")); + ModuleManager.Register(Path.Combine(dir.FullName, "PatchManager.Missions.dll")); // ModuleManager.Register(Path.Combine(dir.FullName, "PatchManager.Planets.dll")); foreach (var module in ModuleManager.Modules) {