You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I looked at the possibility to support some basic namespaces for built-in functions, for example math for mathematical functions (math.Round, math.Trunc, math.Abs), or str for string operations (str.Title, str.ToLower), and so on... However, I realized there is a bug with the current implementation which is somehow related to what looked at, i.e. IDENT '.' IDENT ( … ) or postfix_expression '.' postfix_expression (…).
The issue is that every function name is registered in the "names" map of the declarations, and the Decls.UseIdent function registers it as an identifier as well, always with a nil value because no value is ever assigned to this identifier, which is in fact just a function name…
This confusion between names, identifiers, and functions also leads to variety of strange situations:
I looked at the possibility to support some basic namespaces for built-in functions, for example
math
for mathematical functions (math.Round
,math.Trunc
,math.Abs
), orstr
for string operations (str.Title
,str.ToLower
), and so on... However, I realized there is a bug with the current implementation which is somehow related to what looked at, i.e.IDENT '.' IDENT ( … )
orpostfix_expression '.' postfix_expression (…)
.The issue is that every function name is registered in the "names" map of the declarations, and the
Decls.UseIdent
function registers it as an identifier as well, always with a nil value because no value is ever assigned to this identifier, which is in fact just a function name…This confusion between names, identifiers, and functions also leads to variety of strange situations:
The text was updated successfully, but these errors were encountered: