Skip to content

Commit

Permalink
refactor: Remove unused code (#143)
Browse files Browse the repository at this point in the history
* refactor: fix typo

* refactor: remove unused code
  • Loading branch information
mikavilpas authored Mar 23, 2024
1 parent 326a02c commit 4401749
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
18 changes: 1 addition & 17 deletions tree-sitter-markdown-inline/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,7 @@ const PRECEDENCE_LEVEL_HTML = 100;
// Punctuation characters as specified in
// https://github.github.com/gfm/#ascii-punctuation-character
const PUNCTUATION_CHARACTERS_REGEX = '!-/:-@\\[-`\\{-~';
const PUNCTUATION_CHARACTERS_ARRAY = [
'!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<',
'=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~'
];

// (https://github.github.com/gfm/#html-blocks)
// tag names for html blocks of type 1
const HTML_TAG_NAMES_RULE_1 = ['pre', 'script', 'style'];
// tag names for html blocks of type 6
const HTML_TAG_NAMES_RULE_7 = [
'address', 'article', 'aside', 'base', 'basefont', 'blockquote', 'body', 'caption', 'center',
'col', 'colgroup', 'dd', 'details', 'dialog', 'dir', 'div', 'dl', 'dt', 'fieldset', 'figcaption',
'figure', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head',
'header', 'hr', 'html', 'iframe', 'legend', 'li', 'link', 'main', 'menu', 'menuitem', 'nav',
'noframes', 'ol', 'optgroup', 'option', 'p', 'param', 'section', 'source', 'summary', 'table',
'tbody', 'td', 'tfoot', 'th', 'thead', 'title', 'tr', 'track', 'ul'
];


// !!!
// Notice the call to `add_inline_rules` which generates some additional rules related to parsing
Expand Down
6 changes: 1 addition & 5 deletions tree-sitter-markdown/grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ const common = require('../common/grammar.js');
const PRECEDENCE_LEVEL_LINK = common.PRECEDENCE_LEVEL_LINK;

const PUNCTUATION_CHARACTERS_REGEX = '!-/:-@\\[-`\\{-~';
const PUNCTUATION_CHARACTERS_ARRAY = [
'!', '"', '#', '$', '%', '&', "'", '(', ')', '*', '+', ',', '-', '.', '/', ':', ';', '<',
'=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', '{', '|', '}', '~'
];

module.exports = grammar({
name: 'markdown',
Expand All @@ -28,7 +24,7 @@ module.exports = grammar({
),

...common.rules,
_last_token_punctuation: $ => choice(), // needed for compatability wiht common rules
_last_token_punctuation: $ => choice(), // needed for compatability with common rules

// BLOCK STRUCTURE

Expand Down

0 comments on commit 4401749

Please sign in to comment.