diff --git a/FileFormat/CodeGen.cs b/FileFormat/CodeGen.cs index ccdc6ef..e5ea5bd 100644 --- a/FileFormat/CodeGen.cs +++ b/FileFormat/CodeGen.cs @@ -397,6 +397,27 @@ bool CheckForGlobalName(string name) return false; } + bool TryParseGlobalName(string name, out Variable v) + { + v = null; + + try + { + CompoundType curr = current; + while (curr != null) + { + v = curr.Variables[name]; + if (v != null) return true; + else curr = curr.Parent; + } + return false; + } + catch + { + return false; + } + } + bool TryParseLocalName(string name, out Variable v) { v = null; @@ -558,7 +579,7 @@ CompoundType CreateStruct(string name, string structName, string countVar) CompoundType c = null; if (CheckForGlobalName(name)) return null; - if (!TryParseLocalName(countVar, out cv)) return null; + if (!TryParseGlobalName(countVar, out cv)) return null; try { diff --git a/FileFormat/Program.cs b/FileFormat/Program.cs index d5aabcf..62a9e12 100644 --- a/FileFormat/Program.cs +++ b/FileFormat/Program.cs @@ -13,6 +13,9 @@ class Program static void Main(string[] args) { + Console.WriteLine("Grider Software FileFormat " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); + Console.WriteLine(); + if (args.Length < 2) { PrintHelp(); @@ -55,9 +58,6 @@ static void Main(string[] args) } } - Console.WriteLine("Grider Software FileFormat " + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()); - Console.WriteLine(); - // Generate code CodeGen code = new CodeGen(inputFile, outputFile); diff --git a/FileFormat/Properties/AssemblyInfo.cs b/FileFormat/Properties/AssemblyInfo.cs index 910de67..c63410a 100644 --- a/FileFormat/Properties/AssemblyInfo.cs +++ b/FileFormat/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.3.25")] -[assembly: AssemblyFileVersion("1.0.3.25")] +[assembly: AssemblyVersion("1.0.4.32")] +[assembly: AssemblyFileVersion("1.0.4.32")]