Exemple #1
0
        protected virtual void GetCodeType()
        {
            // Get the type.
            CodeType type = CodeType.GetCodeTypeFromContext(_parseInfo, _contextHandler.GetCodeType());

            if (type != null && type.Constant() != TypeSettable.Normal)
            {
                _varInfo.IsWorkshopReference = true;
            }

            _varInfo.Type = type;
        }
        protected override void GetCodeType()
        {
            var      context = _contextHandler.GetCodeType();
            CodeType type    = CodeType.GetCodeTypeFromContext(_parseInfo, context);

            if (type != null && type.Constant() == TypeSettable.Constant)
            {
                _diagnostics.Error($"Constant types cannot be used in subroutine parameters.", DocRange.GetRange(context));
            }

            _varInfo.Type = type;
        }
Exemple #3
0
 public bool Settable()
 {
     return((CodeType == null || CodeType.Constant() == TypeSettable.Normal) && (VariableType == VariableType.Global || VariableType == VariableType.Player || VariableType == VariableType.Dynamic));
 }