Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore: [#116]Validate the syntax in the Code Editor #141

Conversation

impAkshat
Copy link
Contributor

Issue: #116

Validate the syntax in the Code Editor
Logic-

  1. For validating instruction format
  • sliced the complete instruction with " "
  • the arguments following the instruction(if any) must contain ":"
  1. For validating nesting format
  • Keeping track of count of previous indentations in previousIndentations
  • Keeping track of count of current indentations in currentIndentations
  • if the currentIndentations > previousIndentations then currentIndentations must be equal to previousIndentations+2
  • if currentIndentations <= previousIndentations nesting is valid
  • if currentIndentations == units.length there is no instruction in the current line, return false

Validate the syntax in the Code Editor
Logic-
1)For validating instruction format
  - sliced the complete instruction with " "
  - the arguments following the instruction(if any) must contain ":"
2) For validating nesting format
  - Keeping track of count of previous indentations in `previousIndentations`
  - Keeping track of count of current indentations in `currentIndentations`
  - if the `currentIndentations > previousIndentations` then `currentIndentations` must be equal to `previousIndentations+2`
  - if `currentIndentations <= previousIndentations` nesting is valid
  - if `currentIndentations == units.length` there is no instruction in the current line, return `false`
@meganindya meganindya added on-hold Issues on hold and removed on-hold Issues on hold labels Feb 11, 2022
@meganindya meganindya added this to the Release v4.1.0 milestone Feb 14, 2022
@meganindya
Copy link
Member

fixed in #180

@meganindya meganindya closed this Mar 5, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants