/** * @file Tree-sitter grammar definition for DTD * @author ObserverOfTime * @license MIT */ /// // @ts-check import * as c from '../common/common.mjs'; const O = optional; export default grammar({ name: 'dtd', externals: $ => [ $.PITarget, $._pi_content, $.Comment, ], extras: _ => [], supertypes: $ => [ $._markupdecl, $._AttType, $._EnumeratedType, $._EntityDecl, $._Reference, ], conflicts: $ => [ [$.AttlistDecl, $.AttDef] ], word: $ => $.Name, rules: { extSubset: $ => seq( O($.TextDecl), repeat1($._extSubsetDecl) ), TextDecl: $ => seq( '' ), _extSubsetDecl: $ => choice( $._markupdecl, $.conditionalSect, $._DeclSep ), conditionalSect: $ => seq( '' ), ...c.rules } });