fix: parse continued latex env as paragraph (close #38)
This commit is contained in:
parent
eb1e080361
commit
081179c52b
8 changed files with 61392 additions and 62734 deletions
|
|
@ -1,7 +1,7 @@
|
|||
[package]
|
||||
name = "tree-sitter-org"
|
||||
description = "org grammar for the tree-sitter parsing library"
|
||||
version = "1.3.2"
|
||||
version = "1.3.3"
|
||||
keywords = ["incremental", "parsing", "org"]
|
||||
categories = ["parsing", "text-editors"]
|
||||
repository = "https://github.com/milisims/tree-sitter-org"
|
||||
|
|
|
|||
|
|
@ -1360,6 +1360,32 @@ LatexEnv.5 - Uppercase
|
|||
name: (name)
|
||||
(name))))
|
||||
|
||||
================================================================================
|
||||
LatexEnv.6a - Junk
|
||||
================================================================================
|
||||
\( a \) b
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(document
|
||||
body: (body
|
||||
(paragraph
|
||||
(expr)
|
||||
(expr)
|
||||
(expr)
|
||||
(expr))))
|
||||
|
||||
================================================================================
|
||||
LatexEnv.6b - Junk
|
||||
================================================================================
|
||||
\( \)
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(document
|
||||
body: (body
|
||||
(paragraph
|
||||
(expr)
|
||||
(expr))))
|
||||
|
||||
================================================================================
|
||||
Precedence.1 - Paragraph comment
|
||||
================================================================================
|
||||
|
|
|
|||
|
|
@ -305,14 +305,12 @@ org_grammar = {
|
|||
token.immediate('}'),
|
||||
),
|
||||
seq(
|
||||
caseInsensitive('\\['),
|
||||
$._nl,
|
||||
token(seq(caseInsensitive('\\['), choice('\n', '\r'))),
|
||||
optional(field('contents', $.contents)),
|
||||
caseInsensitive('\\]'),
|
||||
),
|
||||
seq(
|
||||
caseInsensitive('\\('),
|
||||
$._nl,
|
||||
token(seq(caseInsensitive('\\('), choice('\n', '\r'))),
|
||||
optional(field('contents', $.contents)),
|
||||
caseInsensitive('\\)'),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "tree-sitter-org",
|
||||
"version": "1.3.2",
|
||||
"version": "1.3.3",
|
||||
"description": "Org grammar for tree-sitter",
|
||||
"main": "bindings/node",
|
||||
"keywords": [
|
||||
|
|
|
|||
|
|
@ -1817,6 +1817,11 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
|
|
@ -1829,8 +1834,20 @@
|
|||
"value": "\\["
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_nl"
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "\r"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
|
|
@ -1860,6 +1877,11 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "TOKEN",
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
|
|
@ -1872,8 +1894,20 @@
|
|||
"value": "\\("
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_nl"
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "\n"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "\r"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
|
|
|
|||
|
|
@ -1114,18 +1114,10 @@
|
|||
"type": "\\",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "\\(",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "\\)",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "\\[",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "\\]",
|
||||
"named": false
|
||||
|
|
|
|||
123981
src/parser.c
123981
src/parser.c
File diff suppressed because it is too large
Load diff
|
|
@ -123,6 +123,7 @@ struct TSLanguage {
|
|||
unsigned (*serialize)(void *, char *);
|
||||
void (*deserialize)(void *, const char *, unsigned);
|
||||
} external_scanner;
|
||||
const TSStateId *primary_state_ids;
|
||||
};
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue