static bool IsBlockKw(byte tk) { switch (tk) { case DTokens.Enum: case DTokens.Alias: case DTokens.This: // ctor case DTokens.If: case DTokens.Static: case DTokens.Assert: case DTokens.Mixin: case DTokens.Import: case DTokens.Module: case DTokens.Unittest: case DTokens.New: case DTokens.Version: case DTokens.Debug: return(true); default: return(DTokens.IsBasicType(tk) || DTokens.IsClassLike(tk) || DTokens.IsStorageClass(tk) || DTokens.IsParamModifier(tk) || DTokens.IsVisibilityModifier(tk)); } }
/// <summary> /// Removes all public,private,protected or package attributes from the list /// </summary> public static void CleanupAccessorAttributes(List <DAttribute> HayStack) { foreach (var i in HayStack.ToArray()) { if (i is Modifier && DTokens.IsVisibilityModifier(((Modifier)i).Token)) { HayStack.Remove(i); } } }
public static bool ContainsAccessorAttribute(Stack <DAttribute> HayStack) { foreach (var i in HayStack) { if (i is Modifier && DTokens.IsVisibilityModifier(((Modifier)i).Token)) { return(true); } } return(false); }
/// <summary> /// Removes all public,private,protected or package attributes from the stack /// </summary> public static void CleanupAccessorAttributes(Stack <DAttribute> HayStack, byte furtherAttrToRemove = 0) { var l = new List <DAttribute>(); while (HayStack.Count > 0) { var attr = HayStack.Pop(); var m = attr as Modifier; if (m == null || (!DTokens.IsVisibilityModifier(m.Token) && m.Token != furtherAttrToRemove)) { l.Add(attr); } } foreach (var i in l) { HayStack.Push(i); } }