-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add initial specs documents #243
Conversation
Note Currently processing new changes in this PR. This may take a few minutes, please wait... Files selected for processing (8)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 18
Outside diff range and nitpick comments (9)
specs/Identifier.md (2)
23-23
: Consider breaking this line to adhere to the 80-character limit for better readability.Tools
GitHub Check: Codacy Static Code Analysis
[notice] 23-23: specs/Identifier.md#L23
Expected: 80; Actual: 120
65-65
: Ensure the file ends with a single newline character.Tools
Markdownlint
65-65: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/method_header.md (3)
40-40
: Add a blank line above each heading for better structure and readability.Also applies to: 55-55
Tools
Markdownlint
40-40: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
42-42
: Surround each code block with blank lines for proper formatting.Also applies to: 44-44, 50-50, 67-67, 74-74, 76-76, 84-84
Tools
Markdownlint
42-42: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
42-42: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
113-113
: Ensure the file ends with a single newline character.Tools
Markdownlint
113-113: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/strings.md (2)
24-24
: Remove trailing punctuation from headings to adhere to Markdown standards.Also applies to: 57-57
Tools
Markdownlint
24-24: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
24-24: Punctuation: ':' (MD026, no-trailing-punctuation)
Trailing punctuation in heading
100-100
: Ensure the file ends with a single newline character.Tools
Markdownlint
100-100: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/type_alias.md (2)
36-36
: Add a blank line above each heading to improve the structure and readability of the document.Also applies to: 42-42, 48-48, 54-54
Tools
Markdownlint
36-36: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
110-110
: Ensure the file ends with a single newline character.Tools
Markdownlint
110-110: null (MD047, single-trailing-newline)
Files should end with a single newline character
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (8)
- specs/Identifier.md (1 hunks)
- specs/expressions.md (1 hunks)
- specs/method_header.md (1 hunks)
- specs/numeric.binary.md (1 hunks)
- specs/numeric.other.md (1 hunks)
- specs/statement.md (1 hunks)
- specs/strings.md (1 hunks)
- specs/type_alias.md (1 hunks)
Additional context used
Markdownlint
specs/Identifier.md
41-41: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
65-65: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/method_header.md
40-40: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
55-55: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
42-42: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
44-44: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
50-50: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
67-67: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
74-74: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
76-76: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
84-84: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
14-14: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
45-45: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
78-78: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
42-42: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
58-58: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
74-74: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
113-113: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/strings.md
25-25: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
28-28: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
31-31: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
36-36: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
39-39: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
59-59: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
61-61: Expected: 0 or 2; Actual: 3 (MD009, no-trailing-spaces)
Trailing spaces
62-62: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
71-71: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
74-74: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
24-24: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
24-24: Punctuation: ':' (MD026, no-trailing-punctuation)
Trailing punctuation in heading
57-57: Punctuation: ':' (MD026, no-trailing-punctuation)
Trailing punctuation in heading
16-16: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
21-21: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
25-25: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
95-95: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
16-16: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
100-100: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/type_alias.md
70-70: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
74-74: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
81-81: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
36-36: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
42-42: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
48-48: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
54-54: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
21-21: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
38-38: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
44-44: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
50-50: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
56-56: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
61-61: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
28-28: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
21-21: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
38-38: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
44-44: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
50-50: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
56-56: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
110-110: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/numeric.binary.md
59-59: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
61-61: Expected: 0 or 2; Actual: 3 (MD009, no-trailing-spaces)
Trailing spaces
62-62: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
68-68: Expected: 0 or 2; Actual: 1 (MD009, no-trailing-spaces)
Trailing spaces
57-57: Punctuation: ':' (MD026, no-trailing-punctuation)
Trailing punctuation in heading
16-16: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
26-26: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
117-117: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
16-16: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
124-124: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/numeric.other.md
92-92: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
123-123: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
147-147: null (MD024, no-duplicate-heading)
Multiple headings with the same content
23-23: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
95-95: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
126-126: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
143-143: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
187-187: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
23-23: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
95-95: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
126-126: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
143-143: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
215-215: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/statement.md
26-26: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
47-47: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
67-67: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
86-86: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
104-104: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
21-21: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
43-43: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
61-61: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
81-81: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
98-98: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
129-129: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
149-149: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
168-168: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
193-193: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
216-216: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
233-233: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
250-250: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
10-10: null (MD032, blanks-around-lists)
Lists should be surrounded by blank lines
21-21: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
43-43: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
61-61: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
81-81: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
98-98: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
129-129: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
149-149: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
168-168: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
193-193: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
216-216: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
233-233: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
250-250: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
296-296: null (MD047, single-trailing-newline)
Files should end with a single newline characterspecs/expressions.md
48-48: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
105-105: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
132-132: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
161-161: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
177-177: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
193-193: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
221-221: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
250-250: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
268-268: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
292-292: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
155-155: Expected: atx; Actual: atx_closed (MD003, heading-style)
Heading style
150-150: Expected: 0 or 2; Actual: 9 (MD009, no-trailing-spaces)
Trailing spaces
151-151: Expected: 0 or 2; Actual: 8 (MD009, no-trailing-spaces)
Trailing spaces
152-152: Expected: 0 or 2; Actual: 7 (MD009, no-trailing-spaces)
Trailing spaces
153-153: Expected: 0 or 2; Actual: 7 (MD009, no-trailing-spaces)
Trailing spaces
154-154: Expected: 0 or 2; Actual: 9 (MD009, no-trailing-spaces)
Trailing spaces
155-155: Expected: 0 or 2; Actual: 5 (MD009, no-trailing-spaces)
Trailing spaces
150-150: Expected: 1; Actual: 0; Below (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
155-155: Expected: 1; Actual: 0; Above (MD022, blanks-around-headings)
Headings should be surrounded by blank lines
14-14: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
44-44: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
80-80: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
100-100: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
128-128: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
173-173: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
211-211: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
246-246: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
14-14: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
44-44: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
80-80: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
100-100: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
128-128: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
173-173: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
211-211: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
246-246: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
315-315: null (MD047, single-trailing-newline)
Files should end with a single newline character
GitHub Check: Codacy Static Code Analysis
specs/Identifier.md
[notice] 1-1: specs/Identifier.md#L1
First line in a file should be a top-level heading
[notice] 23-23: specs/Identifier.md#L23
Expected: 80; Actual: 120
[notice] 39-39: specs/Identifier.md#L39
Expected: 80; Actual: 105
[notice] 41-41: specs/Identifier.md#L41
Fenced code blocks should have a language specifiedspecs/strings.md
[notice] 1-1: specs/strings.md#L1
First line in a file should be a top-level heading
[notice] 5-5: specs/strings.md#L5
Expected: 80; Actual: 191
[notice] 25-25: specs/strings.md#L25
Expected: 0 or 2; Actual: 1specs/type_alias.md
[notice] 65-65: specs/type_alias.md#L65
Expected: 80; Actual: 94specs/numeric.binary.md
[notice] 16-16: specs/numeric.binary.md#L16
Fenced code blocks should be surrounded by blank lines
[notice] 61-61: specs/numeric.binary.md#L61
Expected: 0 or 2; Actual: 3
[notice] 68-68: specs/numeric.binary.md#L68
Expected: 0 or 2; Actual: 1
[notice] 79-79: specs/numeric.binary.md#L79
Expected: 80; Actual: 195
[notice] 90-90: specs/numeric.binary.md#L90
Expected: 80; Actual: 93
[notice] 117-117: specs/numeric.binary.md#L117
Lists should be surrounded by blank linesspecs/numeric.other.md
[notice] 23-23: specs/numeric.other.md#L23
Fenced code blocks should have a language specified
[notice] 101-101: specs/numeric.other.md#L101
Multiple headings with the same content
[notice] 215-215: specs/numeric.other.md#L215
Expected: 80; Actual: 351
[notice] 215-215: specs/numeric.other.md#L215
Files should end with a single newline characterspecs/statement.md
[notice] 80-80: specs/statement.md#L80
Expected: 80; Actual: 103
[notice] 124-124: specs/statement.md#L124
Expected: 80; Actual: 90specs/expressions.md
[notice] 53-53: specs/expressions.md#L53
Expected: 80; Actual: 95
[notice] 154-154: specs/expressions.md#L154
Expected: 0 or 2; Actual: 9
[notice] 154-154: specs/expressions.md#L154
Expected: 80; Actual: 148
[notice] 155-155: specs/expressions.md#L155
Expected: atx; Actual: atx_closed
[notice] 193-193: specs/expressions.md#L193
Expected: h4; Actual: h5
LanguageTool
specs/statement.md
[grammar] ~167-~167: The preposition ‘for’ is repeated. Make sure that it is correct. (IN_DT_IN)
Context: ...y);#### For Statement The syntax for a for statement is:
ForStatement ::= 'for...
Additional comments not posted (14)
specs/numeric.binary.md (1)
35-41
: The parsing logic forBinaryLiteralExpression
appears correct and well-structured. However, ensure that the replacement of underscores and the handling of optional type suffixes are thoroughly tested, especially edge cases where underscores might be misused.specs/numeric.other.md (4)
37-62
: The parser implementation forFloatLiteralExpression
is comprehensive. However, please ensure that the complex chaining of parsers is well-documented to aid future maintainers in understanding the flow and logic.
106-110
: The implementation forIntLiteralExpression
is straightforward and well-structured. Ensure that the optional suffix handling is robust, especially in edge cases.
135-138
: The parser forBooleanLiteralExpression
is concise and correctly implements the expected behavior for boolean literals. Good job on keeping the implementation straightforward and readable.
152-155
: The implementation forNullLiteralExpression
is minimal and effective. This simplicity is appreciated in the context of parsing null literals.specs/statement.md (9)
31-37
: The parser rule forStatement
is well-structured, leveraging preview and comment features effectively. Ensure that the integration of comments with statements is thoroughly tested to handle edge cases.
62-76
: The implementation forlocal_variable_declaration
is robust, supporting bothauto
andlet
declarations. This flexibility is crucial for modern programming paradigms.Tools
Markdownlint
67-67: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
82-93
: The parser rule forembedded_statement
is concise and effectively handles different types of embedded statements. Good use of theOr
combinator to simplify the syntax tree.Tools
Markdownlint
86-86: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
99-119
: Thesimple_embedded_statement
parser is comprehensive, covering a wide range of statement types. Ensure that each branch is covered in unit tests to verify correct parsing and error handling.Tools
Markdownlint
104-104: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
150-163
: TheWhileStatement
parser correctly implements the looping construct with condition checking. This implementation is crucial for supporting iterative behaviors in the language.
169-188
: Thefor_statement
parser is well-implemented, supporting optional loop variables and expressions. This flexibility is important for different loop configurations.
[APROVED]
194-210
: Theforeach_statement
parser effectively handles theforeach
loop syntax, including thein
keyword. This is a key feature for iterating over collections.
217-228
: TheReturnStatement
parser is straightforward and correctly handles optional expressions. This simplicity is beneficial for parsing return statements efficiently.
234-245
: TheFailStatement
andDeleteStatement
parsers are minimal yet effective, correctly handling optional expressions followed by a semicolon. These parsers are essential for error handling and resource management in the language.
|
||
The following grammar describes the structure of an `IdentifierExpression` using the rules defined above: | ||
|
||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify the language for the code block to enhance syntax highlighting.
- ```
+ ```vein
Tools
Markdownlint
41-41: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
GitHub Check: Codacy Static Code Analysis
[notice] 41-41: specs/Identifier.md#L41
Fenced code blocks should have a language specified
@@ -0,0 +1,65 @@ | |||
### ECMA Specification for Vein Language Identifier Expression |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a top-level heading to conform to Markdown best practices.
+ # ECMA Specification for Vein Language Identifier Expression
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
### ECMA Specification for Vein Language Identifier Expression | |
# ECMA Specification for Vein Language Identifier Expression | |
### ECMA Specification for Vein Language Identifier Expression |
Tools
GitHub Check: Codacy Static Code Analysis
[notice] 1-1: specs/Identifier.md#L1
First line in a file should be a top-level heading
|
||
##### Parameter Declaration | ||
Each parameter is declared as follows: | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Specify the language for all code blocks to enable syntax highlighting.
- ```
+ ```vein
Also applies to: 58-58, 74-74
Tools
Markdownlint
42-42: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
42-42: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
##### String Literal | ||
|
||
The basic syntax for a string literal is: | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surround the code block with blank lines and specify the language for syntax highlighting.
+ ```vein
StringLiteral ::= '"' (Character | EscapedCharacter)* '"'
+ ```
Tools
Markdownlint
16-16: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
16-16: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
##### Alias Declaration | ||
|
||
The basic syntax for an alias declaration is as follows: | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surround each code block with blank lines and specify the language for enhanced readability and syntax highlighting.
+ ```vein
AliasDeclaration ::= ('global' 'alias' IdentifierExpression '=' TypeExpression ';')
| ('alias' IdentifierExpression '=' TypeExpression ';')
| ('alias' IdentifierExpression '=' MethodParametersAndBody ';')
+ ```
Also applies to: 38-38, 44-44, 50-50, 56-56
Tools
Markdownlint
21-21: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
21-21: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
private Parser<NumericSuffix> FloatTypeSuffix => | ||
Parse.Chars("FfDdMmHh").Select(char.ToLowerInvariant).Select(x => x switch | ||
{ | ||
'f' => NumericSuffix.Float, | ||
'd' => NumericSuffix.Double, | ||
'm' => NumericSuffix.Decimal, | ||
'h' => NumericSuffix.Half, | ||
_ => NumericSuffix.None | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The FloatTypeSuffix
parser is concise and well-implemented. Consider using a dictionary or similar data structure for mapping suffixes to their respective NumericSuffix
values to enhance maintainability.
+ private readonly Dictionary<char, NumericSuffix> suffixMap = new Dictionary<char, NumericSuffix>
+ {
+ {'f', NumericSuffix.Float},
+ {'d', NumericSuffix.Double},
+ {'m', NumericSuffix.Decimal},
+ {'h', NumericSuffix.Half}
+ };
- Parse.Chars("FfDdMmHh").Select(char.ToLowerInvariant).Select(x => x switch
+ Parse.Chars("FfDdMmHh").Select(char.ToLowerInvariant).Select(x => suffixMap[x]);
Committable suggestion was skipped due to low confidence.
``` | ||
Statement ::= DeclarationStatement | ||
| EmbeddedStatement | ||
``` | ||
|
||
##### Parser Implementation | ||
|
||
The parser rule for `Statement` is structured as follows: | ||
|
||
```csharp | ||
protected internal virtual Parser<StatementSyntax> Statement => | ||
from statement in | ||
declarationStatement.OrPreview(embedded_statement) | ||
.Commented(this) | ||
select statement.Value | ||
.WithLeadingComments(statement.LeadingComments) | ||
.WithTrailingComments(statement.TrailingComments); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a language specifier to the fenced code block for proper syntax highlighting and readability.
- ```
+ ```csharp
Tools
Markdownlint
26-26: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
21-21: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
21-21: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
DeclarationStatement ::= LocalVariableDeclaration ';' | ||
``` | ||
|
||
##### Parser Implementation | ||
|
||
The parser rule for `declarationStatement` is structured as follows: | ||
|
||
```csharp | ||
protected internal virtual Parser<StatementSyntax> declarationStatement => | ||
from loc in local_variable_declaration.Token().Positioned() | ||
from s in Parse.Char(';').Token().Optional() | ||
select ValidateSemicolon(s, loc); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parsing rule for declarationStatement
correctly implements optional semicolon handling. However, consider adding a detailed comment explaining the ValidateSemicolon
method's logic for clarity.
+ // Validates the presence of a semicolon after a declaration statement
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
DeclarationStatement ::= LocalVariableDeclaration ';' | |
``` | |
##### Parser Implementation | |
The parser rule for `declarationStatement` is structured as follows: | |
```csharp | |
protected internal virtual Parser<StatementSyntax> declarationStatement => | |
from loc in local_variable_declaration.Token().Positioned() | |
from s in Parse.Char(';').Token().Optional() | |
select ValidateSemicolon(s, loc); | |
``` | |
DeclarationStatement ::= LocalVariableDeclaration ';' | |
##### Parser Implementation | |
The parser rule for `declarationStatement` is structured as follows: | |
```csharp | |
protected internal virtual Parser<StatementSyntax> declarationStatement => | |
from loc in local_variable_declaration.Token().Positioned() | |
from s in Parse.Char(';').Token().Optional() | |
select ValidateSemicolon(s, loc); | |
// Validates the presence of a semicolon after a declaration statement |
Tools
Markdownlint
47-47: Expected: h4; Actual: h5 (MD001, heading-increment)
Heading levels should only increment by one level at a time
IfStatement ::= 'if' '(' QualifiedExpression ')' Statement ('else' Statement)? | ||
``` | ||
|
||
##### Parser Implementation | ||
|
||
The parser rule for `IfStatement` is structured as follows: | ||
|
||
```csharp | ||
protected internal virtual Parser<IfStatementSyntax> IfStatement => | ||
from ifKeyword in Keyword("if").Token() | ||
from expression in WrappedExpression('(', ')', QualifiedExpression) | ||
from thenBranch in Statement | ||
from elseBranch in Keyword("else").Token(this).Then(_ => Statement).Optional() | ||
select new IfStatementSyntax(expression, thenBranch, elseBranch.GetOrDefault()); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation for IfStatement
accurately captures the syntax and optional else
branch. Consider adding examples in the comments to illustrate the use of this parser with typical if-else
constructs.
+ // Example: if (condition) { ... } else { ... }
Committable suggestion was skipped due to low confidence.
``` | ||
Block ::= '{' Statements '}' | ||
Statements ::= Statement* | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a language specifier to the fenced code block for proper syntax highlighting and readability.
- ```
+ ```ebnf
Tools
Markdownlint
14-14: null (MD031, blanks-around-fences)
Fenced code blocks should be surrounded by blank lines
14-14: null (MD040, fenced-code-language)
Fenced code blocks should have a language specified
Summary by CodeRabbit
New Features
Enhancements
if
,for
,foreach
,while
,return
,fail
, anddelete
.These changes enhance the overall parsing capabilities and syntax handling of the Vein Language, providing more robust language features and error handling.