Using old temporary variable name generation for single-letter types

(e.g., i, j, k, and so on).
This commit is contained in:
Stan Angeloff 2010-09-21 07:53:52 +03:00
parent 69942c9a81
commit 921ab3ce68
1 changed files with 4 additions and 1 deletions

View File

@ -68,7 +68,10 @@ exports.Scope = class Scope
# Generate a temporary variable name at the given index. # Generate a temporary variable name at the given index.
temporary: (type, index) -> temporary: (type, index) ->
'_' + type + if index > 1 then index else '' if type.length > 1
'_' + type + if index > 1 then index else ''
else
'_' + (index + parseInt type, 36).toString(36).replace /\d/g, 'a'
# If we need to store an intermediate result, find an available name for a # If we need to store an intermediate result, find an available name for a
# compiler-generated variable. `_var`, `_var2`, and so on... # compiler-generated variable. `_var`, `_var2`, and so on...