mirror of https://github.com/Wilfred/difftastic/
Formatting and other nitpicks
parent
ddc1421229
commit
f6b4a5e38b
@ -1,4 +1,4 @@
|
|||||||
* text=auto
|
* text=auto
|
||||||
|
|
||||||
**/src/** linguist-generated
|
**/src/*.json linguist-generated
|
||||||
**/bindings/node/binding.cc linguist-generated
|
**/src/parser.c linguist-generated
|
||||||
|
|||||||
@ -1,37 +1,13 @@
|
|||||||
#include <ctype.h>
|
|
||||||
#include <tree_sitter/parser.h>
|
|
||||||
#include <wctype.h>
|
|
||||||
|
|
||||||
#include "../../common/scanner.h"
|
#include "../../common/scanner.h"
|
||||||
|
|
||||||
void *tree_sitter_dtd_external_scanner_create() { return NULL; }
|
static inline bool in_error_recovery(const bool *valid_symbols) {
|
||||||
|
return valid_symbols[PITarget] && valid_symbols[PIContent] && valid_symbols[CharData];
|
||||||
void tree_sitter_dtd_external_scanner_destroy(void *payload) {}
|
|
||||||
|
|
||||||
void tree_sitter_dtd_external_scanner_reset(void *payload) {}
|
|
||||||
|
|
||||||
unsigned tree_sitter_dtd_external_scanner_serialize(void *payload,
|
|
||||||
char *buffer) {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tree_sitter_dtd_external_scanner_deserialize(void *payload,
|
bool tree_sitter_dtd_external_scanner_scan(void *payload, TSLexer *lexer, const bool *valid_symbols) {
|
||||||
const char *buffer,
|
SCAN_COMMON(lexer, valid_symbols)
|
||||||
unsigned length) {}
|
|
||||||
|
|
||||||
bool tree_sitter_dtd_external_scanner_scan(void *payload, TSLexer *lexer,
|
|
||||||
const bool *valid_symbols) {
|
|
||||||
if (in_dtd_error_recovery(valid_symbols)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid_symbols[PITarget]) {
|
|
||||||
return scan_pi_target(lexer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid_symbols[PIContent]) {
|
|
||||||
return scan_pi_content(lexer);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCANNER_BOILERPLATE(dtd)
|
||||||
|
|||||||
@ -1,41 +1,16 @@
|
|||||||
#include <ctype.h>
|
|
||||||
#include <tree_sitter/parser.h>
|
|
||||||
#include <wctype.h>
|
|
||||||
|
|
||||||
#include "../../common/scanner.h"
|
#include "../../common/scanner.h"
|
||||||
|
|
||||||
void *tree_sitter_xml_external_scanner_create() { return NULL; }
|
static inline bool in_error_recovery(const bool *valid_symbols) {
|
||||||
|
return valid_symbols[PITarget] && valid_symbols[PIContent];
|
||||||
void tree_sitter_xml_external_scanner_destroy(void *payload) {}
|
|
||||||
|
|
||||||
void tree_sitter_xml_external_scanner_reset(void *payload) {}
|
|
||||||
|
|
||||||
unsigned tree_sitter_xml_external_scanner_serialize(void *payload,
|
|
||||||
char *buffer) {
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void tree_sitter_xml_external_scanner_deserialize(void *payload,
|
|
||||||
const char *buffer,
|
|
||||||
unsigned length) {}
|
|
||||||
|
|
||||||
bool tree_sitter_xml_external_scanner_scan(void *payload, TSLexer *lexer,
|
bool tree_sitter_xml_external_scanner_scan(void *payload, TSLexer *lexer,
|
||||||
const bool *valid_symbols) {
|
const bool *valid_symbols) {
|
||||||
if (in_xml_error_recovery(valid_symbols)) {
|
SCAN_COMMON(lexer, valid_symbols)
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid_symbols[PITarget]) {
|
|
||||||
return scan_pi_target(lexer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid_symbols[PIContent]) {
|
if (valid_symbols[CharData]) return scan_char_data(lexer);
|
||||||
return scan_pi_content(lexer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (valid_symbols[CharData]) {
|
|
||||||
return scan_char_data(lexer);
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SCANNER_BOILERPLATE(xml)
|
||||||
|
|||||||
Loading…
Reference in New Issue