xref: /Universal-ctags/optlib/iPythonCell.c (revision eb8ac46574f4815b08604eff66417a522d20fd01)
1*2d0d9377SMasatake YAMATO /*
2*2d0d9377SMasatake YAMATO  * Generated by ./misc/optlib2c from optlib/iPythonCell.ctags, Don't edit this manually.
3*2d0d9377SMasatake YAMATO  */
4*2d0d9377SMasatake YAMATO #include "general.h"
5*2d0d9377SMasatake YAMATO #include "parse.h"
6*2d0d9377SMasatake YAMATO #include "routines.h"
7*2d0d9377SMasatake YAMATO #include "field.h"
8*2d0d9377SMasatake YAMATO #include "xtag.h"
9*2d0d9377SMasatake YAMATO #include "subparser.h"
10*2d0d9377SMasatake YAMATO 
11*2d0d9377SMasatake YAMATO 
initializeIPythonCellParser(const langType language CTAGS_ATTR_UNUSED)12*2d0d9377SMasatake YAMATO static void initializeIPythonCellParser (const langType language CTAGS_ATTR_UNUSED)
13*2d0d9377SMasatake YAMATO {
14*2d0d9377SMasatake YAMATO }
15*2d0d9377SMasatake YAMATO 
IPythonCellParser(void)16*2d0d9377SMasatake YAMATO extern parserDefinition* IPythonCellParser (void)
17*2d0d9377SMasatake YAMATO {
18*2d0d9377SMasatake YAMATO 	static const char *const extensions [] = {
19*2d0d9377SMasatake YAMATO 		NULL
20*2d0d9377SMasatake YAMATO 	};
21*2d0d9377SMasatake YAMATO 
22*2d0d9377SMasatake YAMATO 	static const char *const aliases [] = {
23*2d0d9377SMasatake YAMATO 		NULL
24*2d0d9377SMasatake YAMATO 	};
25*2d0d9377SMasatake YAMATO 
26*2d0d9377SMasatake YAMATO 	static const char *const patterns [] = {
27*2d0d9377SMasatake YAMATO 		NULL
28*2d0d9377SMasatake YAMATO 	};
29*2d0d9377SMasatake YAMATO 
30*2d0d9377SMasatake YAMATO 	static kindDefinition IPythonCellKindTable [] = {
31*2d0d9377SMasatake YAMATO 		{
32*2d0d9377SMasatake YAMATO 		  true, 'c', "cell", "cells",
33*2d0d9377SMasatake YAMATO 		},
34*2d0d9377SMasatake YAMATO 	};
35*2d0d9377SMasatake YAMATO 	static xtagDefinition IPythonCellXtagTable [] = {
36*2d0d9377SMasatake YAMATO 		{
37*2d0d9377SMasatake YAMATO 		  .enabled     = false,
38*2d0d9377SMasatake YAMATO 		  .name        = "doubleSharps",
39*2d0d9377SMasatake YAMATO 		  .description = "Include cells starting from ##",
40*2d0d9377SMasatake YAMATO 		},
41*2d0d9377SMasatake YAMATO 	};
42*2d0d9377SMasatake YAMATO 	static tagRegexTable IPythonCellTagRegexTable [] = {
43*2d0d9377SMasatake YAMATO 		{"^[ \t]*(# ?%%|# <codecell>)[ \t]*(.*[^ \t])$", "\\2",
44*2d0d9377SMasatake YAMATO 		"c", "{exclusive}", NULL, false},
45*2d0d9377SMasatake YAMATO 		{"^[ \t]*##[ \t]*(.*[^ \t])$", "\\1",
46*2d0d9377SMasatake YAMATO 		"c", "{_extra=doubleSharps}{exclusive}", NULL, false},
47*2d0d9377SMasatake YAMATO 	};
48*2d0d9377SMasatake YAMATO 
49*2d0d9377SMasatake YAMATO 	static subparser IPythonCellSubparser = {
50*2d0d9377SMasatake YAMATO 		.direction = SUBPARSER_BASE_RUNS_SUB,
51*2d0d9377SMasatake YAMATO 	};
52*2d0d9377SMasatake YAMATO 	static parserDependency IPythonCellDependencies [] = {
53*2d0d9377SMasatake YAMATO 		[0] = { DEPTYPE_SUBPARSER, "Python", &IPythonCellSubparser },
54*2d0d9377SMasatake YAMATO 	};
55*2d0d9377SMasatake YAMATO 
56*2d0d9377SMasatake YAMATO 	parserDefinition* const def = parserNew ("IPythonCell");
57*2d0d9377SMasatake YAMATO 
58*2d0d9377SMasatake YAMATO 	def->enabled       = true;
59*2d0d9377SMasatake YAMATO 	def->extensions    = extensions;
60*2d0d9377SMasatake YAMATO 	def->patterns      = patterns;
61*2d0d9377SMasatake YAMATO 	def->aliases       = aliases;
62*2d0d9377SMasatake YAMATO 	def->method        = METHOD_NOT_CRAFTED|METHOD_REGEX;
63*2d0d9377SMasatake YAMATO 	def->kindTable     = IPythonCellKindTable;
64*2d0d9377SMasatake YAMATO 	def->kindCount     = ARRAY_SIZE(IPythonCellKindTable);
65*2d0d9377SMasatake YAMATO 	def->xtagTable     = IPythonCellXtagTable;
66*2d0d9377SMasatake YAMATO 	def->xtagCount     = ARRAY_SIZE(IPythonCellXtagTable);
67*2d0d9377SMasatake YAMATO 	def->tagRegexTable = IPythonCellTagRegexTable;
68*2d0d9377SMasatake YAMATO 	def->tagRegexCount = ARRAY_SIZE(IPythonCellTagRegexTable);
69*2d0d9377SMasatake YAMATO 	def->dependencies    = IPythonCellDependencies;
70*2d0d9377SMasatake YAMATO 	def->dependencyCount = ARRAY_SIZE(IPythonCellDependencies);
71*2d0d9377SMasatake YAMATO 	def->initialize    = initializeIPythonCellParser;
72*2d0d9377SMasatake YAMATO 
73*2d0d9377SMasatake YAMATO 	return def;
74*2d0d9377SMasatake YAMATO }
75