internal static string GetWhiteSpace(Node node, PythonAst ast, object kind, string defaultValue = " ")
 {
     if (ast.TryGetAttribute(node, kind, out var whitespace))
     {
         return((string)whitespace);
     }
     else
     {
         return(defaultValue);
     }
 }
Beispiel #2
0
        public static string GetVerbatimImage(this Node node, PythonAst ast)
        {
            object image;

            if (ast.TryGetAttribute(node, NodeAttributes.VerbatimImage, out image))
            {
                return((string)image);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public static string[] GetNamesWhiteSpace(this Node node, PythonAst ast)
        {
            object whitespace;

            if (ast.TryGetAttribute(node, NodeAttributes.NamesWhiteSpace, out whitespace))
            {
                return((string[])whitespace);
            }
            else
            {
                return(null);
            }
        }
Beispiel #4
0
        public static bool IsMissingCloseGrouping(this Node node, PythonAst ast)
        {
            object dummy;

            if (ast.TryGetAttribute(node, NodeAttributes.ErrorMissingCloseGrouping, out dummy))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #5
0
        public static bool IsIncompleteNode(this Node node, PythonAst ast)
        {
            object dummy;

            if (ast.TryGetAttribute(node, NodeAttributes.ErrorIncompleteNode, out dummy))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #6
0
        public static string[] GetVerbatimNames(this Node node, PythonAst ast)
        {
            object names;

            if (ast.TryGetAttribute(node, NodeAttributes.VerbatimNames, out names))
            {
                return((string[])names);
            }
            else
            {
                return(null);
            }
        }
Beispiel #7
0
        public static bool IsAltForm(this Node node, PythonAst ast)
        {
            object dummy;

            if (ast.TryGetAttribute(node, NodeAttributes.IsAltFormValue, out dummy))
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #8
0
 public static string GetVerbatimImage(this Node node, PythonAst ast) {
     object image;
     if (ast.TryGetAttribute(node, NodeAttributes.VerbatimImage, out image)) {
         return (string)image;
     } else {
         return null;
     }
 }
Beispiel #9
0
 public static string[] GetVerbatimNames(this Node node, PythonAst ast) {
     object names;
     if (ast.TryGetAttribute(node, NodeAttributes.VerbatimNames, out names)) {
         return (string[])names;
     } else {
         return null;
     }
 }
 public static bool IsIncompleteNode(this Node node, PythonAst ast)
 => ast.TryGetAttribute(node, NodeAttributes.ErrorIncompleteNode, out var dummy);
 public static bool IsAltForm(this Node node, PythonAst ast)
 => ast.TryGetAttribute(node, NodeAttributes.IsAltFormValue, out var dummy);
Beispiel #12
0
 public static bool IsMissingCloseGrouping(this Node node, PythonAst ast) {
     object dummy;
     if (ast.TryGetAttribute(node, NodeAttributes.ErrorMissingCloseGrouping, out dummy)) {
         return true;
     } else {
         return false;
     }
 }
Beispiel #13
0
 public static bool IsAltForm(this Node node, PythonAst ast) {
     object dummy;
     if (ast.TryGetAttribute(node, NodeAttributes.IsAltFormValue, out dummy)) {
         return true;
     } else {
         return false;
     }
 }
Beispiel #14
0
 internal static string GetWhiteSpace(Node node, PythonAst ast, object kind, string defaultValue = " ") {
     object whitespace;
     if (ast.TryGetAttribute(node, kind, out whitespace)) {
         return (string)whitespace;
     } else {
         return defaultValue;
     }
 }
 public static string GetVerbatimImage(this Node node, PythonAst ast)
 => ast.TryGetAttribute(node, NodeAttributes.VerbatimImage, out var image) ? (string)image : null;
 public static string[] GetVerbatimNames(this Node node, PythonAst ast)
 => ast.TryGetAttribute(node, NodeAttributes.VerbatimNames, out var names) ? (string[])names : null;
 public static string[] GetNamesWhiteSpace(this Node node, PythonAst ast)
 => ast.TryGetAttribute(node, NodeAttributes.NamesWhiteSpace, out var whitespace) ? (string[])whitespace : null;
Beispiel #18
0
 public static string[] GetNamesWhiteSpace(this Node node, PythonAst ast) {
     object whitespace;
     if (ast.TryGetAttribute(node, NodeAttributes.NamesWhiteSpace, out whitespace)) {
         return (string[])whitespace;
     } else {
         return null;
     }
 }
Beispiel #19
0
 public static bool IsIncompleteNode(this Node node, PythonAst ast) {
     object dummy;
     if (ast.TryGetAttribute(node, NodeAttributes.ErrorIncompleteNode, out dummy)) {
         return true;
     } else {
         return false;
     }
 }
 public static bool IsMissingCloseGrouping(this Node node, PythonAst ast)
 => ast.TryGetAttribute(node, NodeAttributes.ErrorMissingCloseGrouping, out var dummy);