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

Commits on Feb 6, 2022

  1. chore: [sugarlabs#116]Validate the syntax in the Code Editor

    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`
    impAkshat committed Feb 6, 2022
    Configuration menu
    Copy the full SHA
    ff36361 View commit details
    Browse the repository at this point in the history