Browse Source

Fix generation of overloads in NAPI by re-ordering final calculated states.

instantiate-types-nested-templates
Joao Matos 5 years ago committed by João Matos
parent
commit
22448e09f4
  1. 5
      src/Generator/Generators/NAPI/NAPISources.cs
  2. 2
      src/Generator/Utils/FSM/DFSM.cs

5
src/Generator/Generators/NAPI/NAPISources.cs

@ -822,6 +822,11 @@ namespace CppSharp.Generators.Cpp @@ -822,6 +822,11 @@ namespace CppSharp.Generators.Cpp
DFSM = Minimize.MinimizeDFSM(DFSM);
#endif
// The construction step above can result in unordered final states, so re-order them to
// make the following code generation steps easier.
DFSM.F = DFSM.F.OrderBy(f => f).ToList();
return DFSM;
}

2
src/Generator/Utils/FSM/DFSM.cs

@ -9,7 +9,7 @@ namespace CppSharp.Utils.FSM @@ -9,7 +9,7 @@ namespace CppSharp.Utils.FSM
public readonly List<char> Sigma = new List<char>();
public readonly List<Transition> Delta = new List<Transition>();
public List<string> Q0 = new List<string>();
public readonly List<string> F = new List<string>();
public List<string> F = new List<string>();
public DFSM(IEnumerable<string> q, IEnumerable<char> sigma, IEnumerable<Transition> delta,
IEnumerable<string> q0, IEnumerable<string> f){

Loading…
Cancel
Save