feat: xml docstring node

pull/625/head^2
Nikolaj Sidorenco 2024-04-26 17:51:53 +07:00
parent 558ece751f
commit 5e39d09278
No known key found for this signature in database
6 changed files with 25403 additions and 18141 deletions

@ -52,6 +52,7 @@ module.exports = grammar({
extras: $ => [
$.block_comment,
$.line_comment,
$.xml_doc,
/[ \s\f\uFEFF\u2060\u200B]|\\\r?n/,
],
@ -1782,7 +1783,8 @@ module.exports = grammar({
//
// Constants (END)
//
//
xml_doc: _ => token(/\/\/\/[^\/][^\n\r]*/),
block_comment: $ => seq('(*', $.block_comment_content, token.immediate('*)')),
line_comment: _ => token(seq('//', /[^\n\r]*/)),

@ -6,6 +6,7 @@
(block_comment)
] @comment @spell
(xml_doc) @comment.doc @spell
(identifier) @variable (#set! "priority" 90)

11
src/grammar.json generated

@ -7690,6 +7690,13 @@
"named": false,
"value": "float"
},
"xml_doc": {
"type": "TOKEN",
"content": {
"type": "PATTERN",
"value": "\\/\\/\\/[^\\/][^\\n\\r]*"
}
},
"block_comment": {
"type": "SEQ",
"members": [
@ -7752,6 +7759,10 @@
"type": "SYMBOL",
"name": "line_comment"
},
{
"type": "SYMBOL",
"name": "xml_doc"
},
{
"type": "PATTERN",
"value": "[ \\s\\f\\uFEFF\\u2060\\u200B]|\\\\\\r?n"

@ -3982,11 +3982,11 @@
},
{
"type": "unit",
"named": false
"named": true
},
{
"type": "unit",
"named": true
"named": false
},
{
"type": "unmanaged",
@ -4032,6 +4032,10 @@
"type": "with",
"named": false
},
{
"type": "xml_doc",
"named": true
},
{
"type": "y",
"named": false

43488
src/parser.c generated

File diff suppressed because it is too large Load Diff

@ -69,7 +69,7 @@ let x = 1
--------------------------------------------------------------------------------
(file
(line_comment)
(xml_doc)
(value_declaration
(function_or_value_defn
(value_declaration_left
@ -133,3 +133,33 @@ let x = @"//comment in string"
(identifier))))
(const
(verbatim_string)))))
================================================================================
xml docstring
================================================================================
/// <summary>
/// super important function
/// </summary>
let f x = x + 1
--------------------------------------------------------------------------------
(file
(xml_doc)
(xml_doc)
(xml_doc)
(value_declaration
(function_or_value_defn
(function_declaration_left
(identifier)
(argument_patterns
(long_identifier
(identifier))))
(infix_expression
(long_identifier_or_op
(long_identifier
(identifier)))
(infix_op)
(const
(int))))))