Skip to content
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

Merged
merged 1 commit into from
Jun 20, 2024
Merged

add initial specs documents #243

merged 1 commit into from
Jun 20, 2024

Conversation

0xF6
Copy link
Member

@0xF6 0xF6 commented Jun 20, 2024

Summary by CodeRabbit

  • New Features

    • Introduced comprehensive ECMA Specifications for the Vein Language, covering Identifier Expressions, Expressions and Blocks, Method Parameter Parsing, Binary Literals, General Literal Expressions, Statement Syntax, String Literals, and Type Alias Declarations.
    • Enhanced parsing capabilities for various literal types, expressions, and statements in the Vein Language.
    • Added parsing rules for new constructs like binary literals, type suffixes, and advanced expressions.
  • Enhancements

    • Updated parsing rules for float, integer, boolean, and null literals.
    • Improved parsing logic for control flow statements such as if, for, foreach, while, return, fail, and delete.

These changes enhance the overall parsing capabilities and syntax handling of the Vein Language, providing more robust language features and error handling.

Copy link
Contributor

coderabbitai bot commented Jun 20, 2024

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

Commits

Files that changed from the base of the PR and between 2698953 and 2e13240.

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)
 _______________________________________________
< Show me the code! And I'll show you the bugs. >
 -----------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).

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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@0xF6 0xF6 merged commit 889c259 into master Jun 20, 2024
5 of 7 checks passed
@vein-lang vein-lang locked and limited conversation to collaborators Jun 20, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 character

specs/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 character

specs/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 character

specs/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

Commits

Files that changed from the base of the PR and between 2698953 and 2e13240.

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 character

specs/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 character

specs/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 character

specs/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 character

specs/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 character

specs/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 character

specs/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 character

specs/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 specified

specs/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: 1

specs/type_alias.md

[notice] 65-65: specs/type_alias.md#L65
Expected: 80; Actual: 94

specs/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 lines

specs/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 character

specs/statement.md

[notice] 80-80: specs/statement.md#L80
Expected: 80; Actual: 103


[notice] 124-124: specs/statement.md#L124
Expected: 80; Actual: 90

specs/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 for BinaryLiteralExpression 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 for FloatLiteralExpression 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 for IntLiteralExpression is straightforward and well-structured. Ensure that the optional suffix handling is robust, especially in edge cases.


135-138: The parser for BooleanLiteralExpression is concise and correctly implements the expected behavior for boolean literals. Good job on keeping the implementation straightforward and readable.


152-155: The implementation for NullLiteralExpression is minimal and effective. This simplicity is appreciated in the context of parsing null literals.

specs/statement.md (9)

31-37: The parser rule for Statement 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 for local_variable_declaration is robust, supporting both auto and let 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 for embedded_statement is concise and effectively handles different types of embedded statements. Good use of the Or 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: The simple_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: The WhileStatement parser correctly implements the looping construct with condition checking. This implementation is crucial for supporting iterative behaviors in the language.


169-188: The for_statement parser is well-implemented, supporting optional loop variables and expressions. This flexibility is important for different loop configurations.
[APROVED]


194-210: The foreach_statement parser effectively handles the foreach loop syntax, including the in keyword. This is a key feature for iterating over collections.


217-228: The ReturnStatement parser is straightforward and correctly handles optional expressions. This simplicity is beneficial for parsing return statements efficiently.


234-245: The FailStatement and DeleteStatement 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:

```
Copy link
Contributor

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
Copy link
Contributor

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.

Suggested change
### 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:
```
Copy link
Contributor

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:
```
Copy link
Contributor

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:
```
Copy link
Contributor

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

Comment on lines +70 to +79
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
});
```
Copy link
Contributor

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.

Comment on lines +21 to +38
```
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);
```
Copy link
Contributor

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

Comment on lines +44 to +56
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);
```
Copy link
Contributor

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.

Suggested change
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

Comment on lines +130 to +144
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());
```
Copy link
Contributor

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.

Comment on lines +14 to +17
```
Block ::= '{' Statements '}'
Statements ::= Statement*
```
Copy link
Contributor

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

@0xF6 0xF6 deleted the feature/spec branch August 12, 2024 02:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant