示例#1
0
 public void Reset()
 {
     GlobalNames.Clear();
     LocalNames.Clear();
     LocalNames.Add(new Dictionary <Object /*!*/, string /*!*/>());
     UsedNames.Clear();
     CurrentCounters.Clear();
     GlobalPlusLocalNames.Clear();
 }
示例#2
0
        public string CreateVariableName(string name)
        {
            name = StringUtility.ToCamelCase(name);

            name = NameGenerator.Default.EnsureUniqueName(name, LocalNames);

            if (SyntaxFacts.GetKeywordKind(name) != SyntaxKind.None)
            {
                name = $"@{name}";
            }

            LocalNames.Add(name);

            return(name);
        }