/// <summary> /// Filters out #region directives with omp parameter /// </summary> /// <param name="nodes">All #region nodes in a document syntax tree</param> /// <returns>#region nodes with omp parameter</returns> public List <DirectiveSyntaxNode> FilterOmpNodes(List <DirectiveSyntaxNode> nodes) { List <DirectiveSyntaxNode> result = new List <DirectiveSyntaxNode>(); foreach (DirectiveSyntaxNode node in nodes) { // defining of directive type DirectiveType type = DirectiveParser.GetDirectiveType(node.RegionDirective.ToFullString()); if (type == DirectiveType.UNKNOWN) { continue; } DirectiveParser parser = _factory.GetParser(type); // parsing of OpenMP-style parameters node.DirectiveInfo = parser.Parse(node.RegionDirective.ToFullString()); result.Add(node); } return(result); }
public void Test(string testDirective, DirectiveType expectedType) { DirectiveType directiveType = DirectiveParser.GetDirectiveType(testDirective); Assert.AreEqual(expectedType, directiveType); }