11// Hashtag directives a user can add to a toot to steer rendering.
22const MACHINE_TAGS : Record < string , number > = { '128' : 128 , '48' : 48 } ;
3- const LANG_TAGS : Record < string , string > = { asm : 'asm' , zxbasic : 'zxbasic' } ;
3+ // #c → z88dk C, #sdcc → SDCC; plus the assemblers and the alt BASIC. (Inline
4+ // source with no language tag defaults to Sinclair BASIC / zmakebas.)
5+ const LANG_TAGS : Record < string , string > = {
6+ asm : 'asm' ,
7+ zxbasic : 'zxbasic' ,
8+ c : 'c' ,
9+ sdcc : 'sdcc' ,
10+ zmac : 'zmac' ,
11+ bas2tap : 'bas2tap' ,
12+ } ;
413
514export interface Directives {
615 machineType ?: number ; // from #128 / #48
@@ -12,10 +21,10 @@ export interface Directives {
1221 * Pull rendering directives out of plain-text toot content (the output of
1322 * htmlToBasic) and return the remaining source.
1423 *
15- * Only the exact recognised tags (#128, #48, #asm, #zxbasic ) are stripped;
16- * every other `#token` is left in place — Sinclair BASIC uses # for stream
17- * numbers (PRINT #2) and Boriel uses #include / #define, so blanket stripping
18- * would corrupt valid programs.
24+ * Only the exact recognised tags (#128, #48, and the language tags below ) are
25+ * stripped; every other `#token` is left in place — Sinclair BASIC uses # for
26+ * stream numbers (PRINT #2) and Boriel/C use #include / #define, so blanket
27+ * stripping would corrupt valid programs.
1928 */
2029export function parseDirectives ( text : string ) : Directives {
2130 let machineType : number | undefined ;
0 commit comments