prko
May 10, 2024, 7:01am
1
Hi there,
Can anyone give me any advice if they know anything about creating and modifying SCDoc modal tags?
I think I have modified the necessary parts correctly (C++ and sc files) but it still does not work as expected:
supercollider:develop
← prko:topic/SCDoc_subsubsection
I have tried again to modify C++ code as follows:
1. changing the following … code block
https://github.com/supercollider/supercollider/blob/fb73f7190e741128a6b1c016020cdffc939c32d0/SCDoc/SCDoc.y#L188-L210
with the help of Gemini 1.5 pro as follows:
```
subsubsection: SUBSUBSECTION words2 eol optsubsubsections { $$ = doc_node_make_take_children("SUBSUBSECTION", $2, $4); }
| METHOD methnames optMETHODARGS eol methodbody
{
$2->id = "METHODNAMES";
$$ = doc_node_make(method_type,$3,$2);
doc_node_add_child($$, $5);
}
| COPYMETHOD words eol {
if ( !(strchr($2, ' ')) ) {
yyerror("COPYMETHOD requires 2 arguments (class name and method name)");
YYERROR;
}
$$ = doc_node_make(
stringEqual(method_type, "CMETHOD") ? "CCOPYMETHOD"
: (stringEqual(method_type, "IMETHOD") ? "ICOPYMETHOD"
: "COPYMETHOD"),
$2, NULL
); }
| PRIVATE commalist eoleof { $$ = doc_node_make_take_children( stringEqual(method_type, "CMETHOD") ? "CPRIVATE"
: "IPRIVATE",
NULL, $2); }
;
```
2. adding the following code
```
(?i:[ \t]*subsubsection::[ \t]*) return SUBSUBSECTION;
```
after https://github.com/supercollider/supercollider/blob/8dc8241d21d37c40424f32ddec3f879127aa6c8c/SCDoc/SCDoc.l#L71
and then
3. adding the following code
```
<metadata,eat>(?i:[ \t]*subsubsection::[ \t]*) BEGIN(metadata); return SUBSUBSECTION;
```
after https://github.com/supercollider/supercollider/blob/8dc8241d21d37c40424f32ddec3f879127aa6c8c/SCDoc/SCDoc.l#L149
4. adding proper code in `SCDoc.sc` and `SCDocRenderer.sc`:
https://github.com/prko/supercollider/blob/subsubsection/SCClassLibrary/SCDoc/SCDoc.sc
https://github.com/prko/supercollider/blob/subsubsection/SCClassLibrary/SCDoc/SCDocRenderer.sc
However, the following error still appears when using `subsubsection::`:
> syntax error, unexpected ::, expecting end of file