示例#1
0
 internal DirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken.DirectiveName, sourceText, syntaxTree)
 {
     Add(directiveToken);
 }
示例#2
0
 internal KernelNameDirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken, sourceText, syntaxTree)
 {
     KernelName = directiveToken.DirectiveName;
 }
示例#3
0
 internal ProxyKernelNameDirectiveNode(
     string remoteKernelName,
     DirectiveToken directiveToken,
     SourceText sourceText,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken, sourceText, syntaxTree)
 {
     RemoteKernelName = remoteKernelName;
 }
 internal ActionDirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText,
     string parentKernelName,
     PolyglotSyntaxTree?syntaxTree) : base(directiveToken, sourceText, syntaxTree)
 {
     ParentKernelName = parentKernelName;
 }
        private bool IsLanguageDirective(DirectiveToken directiveToken)
        {
            if (_kernelChooserDirectives is null)
            {
                _kernelChooserDirectives = new HashSet <string>(
                    _directives
                    .OfType <ChooseKernelDirective>()
                    .SelectMany(c => c.Aliases));
            }

            return(_kernelChooserDirectives.Contains(directiveToken.Text));
        }
示例#6
0
        private bool IsLanguageDirective(DirectiveToken directiveToken)
        {
            if (_kernelChooserDirectives is null &&
                _subkernelDirectiveParsersByLanguageName != null)
            {
                _kernelChooserDirectives = new HashSet <string>(
                    _rootKernelDirectiveParser
                    .Configuration
                    .RootCommand
                    .Children
                    .OfType <ChooseKernelDirective>()
                    .SelectMany(c => c.Aliases)
                    );
            }

            return(_kernelChooserDirectives?.Contains(directiveToken.Text) == true);
        }
示例#7
0
 internal DirectiveNode(DirectiveToken directiveToken, SourceText sourceText) : base("#!-directive", sourceText)
 {
     Add(directiveToken);
 }
示例#8
0
 internal KernelDirectiveNode(
     DirectiveToken directiveToken,
     SourceText sourceText) : base(directiveToken, sourceText)
 {
     KernelName = directiveToken.DirectiveName;
 }