重构语法树/符号表
This commit is contained in:
@@ -123,6 +123,10 @@
|
||||
"codeDescriptionSupport": true,
|
||||
"dataSupport": true
|
||||
},
|
||||
"diagnostic": {
|
||||
"dynamicRegistration": true,
|
||||
"relatedDocumentSupport": false
|
||||
},
|
||||
"synchronization": {
|
||||
"dynamicRegistration": true,
|
||||
"willSave": true,
|
||||
@@ -431,10 +435,6 @@
|
||||
"label.command"
|
||||
]
|
||||
}
|
||||
},
|
||||
"diagnostic": {
|
||||
"dynamicRegistration": true,
|
||||
"relatedDocumentSupport": false
|
||||
}
|
||||
},
|
||||
"window": {
|
||||
@@ -484,4 +484,4 @@
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,6 @@ void test_json_string()
|
||||
std::cout << "processId = " << params.processId.value() << "\n";
|
||||
else
|
||||
std::cout << "processId = null\n";
|
||||
std::cout << "rootUri = " << params.rootUri.value() << std::endl;
|
||||
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
function MyFunc(a: string; b: array of string);
|
||||
begin
|
||||
end
|
||||
function MyFunc(a: string; b: array of string);overload;
|
||||
begin
|
||||
end;
|
||||
|
||||
// type ImageDimensions = class
|
||||
// property Width read width_;
|
||||
// property Width : array of string index 2 read width_;
|
||||
|
||||
@@ -99,8 +99,9 @@ module.exports = grammar({
|
||||
$.try_statement,
|
||||
|
||||
$.anonymous_function_statement,
|
||||
$.function_declaration_statement,
|
||||
// $.function_declaration_statement,
|
||||
$.function_definition_statement,
|
||||
$.function_definition_statement_with_overload,
|
||||
$.class_definition_statement,
|
||||
$.external_method_statement,
|
||||
|
||||
@@ -1113,14 +1114,14 @@ module.exports = grammar({
|
||||
anonymous_function_statement: ($) =>
|
||||
seq($.anonymous_function_expression, optional(kSemicolon)),
|
||||
|
||||
function_declaration_statement: ($) =>
|
||||
seq(
|
||||
kw("function"),
|
||||
field("name", $.identifier),
|
||||
$._parameter_signature,
|
||||
optional(field("return_type", $._type_clause)),
|
||||
kSemicolon,
|
||||
),
|
||||
// function_declaration_statement: ($) =>
|
||||
// seq(
|
||||
// kw("function"),
|
||||
// field("name", $.identifier),
|
||||
// $._parameter_signature,
|
||||
// optional(field("return_type", $._type_clause)),
|
||||
// kSemicolon,
|
||||
// ),
|
||||
|
||||
function_definition_statement: ($) =>
|
||||
seq(
|
||||
@@ -1133,6 +1134,19 @@ module.exports = grammar({
|
||||
optional(kSemicolon),
|
||||
),
|
||||
|
||||
function_definition_statement_with_overload: ($) =>
|
||||
seq(
|
||||
kw("function"),
|
||||
field("name", $.identifier),
|
||||
$._parameter_signature,
|
||||
field("return_type", optional($._type_clause)),
|
||||
kSemicolon,
|
||||
kw("overload"),
|
||||
kSemicolon,
|
||||
field("body", $.block_statement),
|
||||
optional(kSemicolon),
|
||||
),
|
||||
|
||||
_parameter_signature: ($) =>
|
||||
seq("(", optional(field("parameters", $.parameter_list)), ")"),
|
||||
|
||||
|
||||
+81
-48
@@ -114,11 +114,11 @@
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "function_declaration_statement"
|
||||
"name": "function_definition_statement"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "function_definition_statement"
|
||||
"name": "function_definition_statement_with_overload"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
@@ -5570,52 +5570,6 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"function_declaration_statement": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "(?i)function"
|
||||
},
|
||||
"named": false,
|
||||
"value": "function"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "name",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_parameter_signature"
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "return_type",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "_type_clause"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ";"
|
||||
}
|
||||
]
|
||||
},
|
||||
"function_definition_statement": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
@@ -5690,6 +5644,85 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"function_definition_statement_with_overload": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "(?i)function"
|
||||
},
|
||||
"named": false,
|
||||
"value": "function"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "name",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "identifier"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_parameter_signature"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "return_type",
|
||||
"content": {
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "_type_clause"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"type": "ALIAS",
|
||||
"content": {
|
||||
"type": "PATTERN",
|
||||
"value": "(?i)overload"
|
||||
},
|
||||
"named": false,
|
||||
"value": "overload"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"type": "FIELD",
|
||||
"name": "body",
|
||||
"content": {
|
||||
"type": "SYMBOL",
|
||||
"name": "block_statement"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "CHOICE",
|
||||
"members": [
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": ";"
|
||||
},
|
||||
{
|
||||
"type": "BLANK"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"_parameter_signature": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
|
||||
+32
-22
@@ -775,11 +775,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -1678,11 +1678,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -1960,9 +1960,19 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true,
|
||||
"fields": {
|
||||
"body": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "block_statement",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"multiple": false,
|
||||
"required": true,
|
||||
@@ -2010,7 +2020,7 @@
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true,
|
||||
"fields": {
|
||||
"body": {
|
||||
@@ -2395,11 +2405,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -2580,11 +2590,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -2766,11 +2776,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -4837,11 +4847,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -5214,11 +5224,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -5668,11 +5678,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -5794,11 +5804,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
@@ -5931,11 +5941,11 @@
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_declaration_statement",
|
||||
"type": "function_definition_statement",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_definition_statement",
|
||||
"type": "function_definition_statement_with_overload",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
|
||||
+109525
-108905
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user