Skip to content

Better "whitespace" checking. #21

Open

Description

@stebanos

Right now, as individual characters goes, only single spaces " " are considered white space, and we tell the parser to skip those in some instances (most importantly when they occur between {{ }} tokens). But sometimes white space is not visible to the eye, causing errors that are hard to spot. Extend the skipWhitespace function to characters that are also considered white space.

The alternative is to make such white space characters visible in the editor. For that, #19 is a prerequisite.

Activity

  1. stebanos commented on Feb 19, 2018

    @stebanos
    MemberAuthor

    I added a WHITESPACE character range in b0c1d1b, because some students had trouble with the ALT+SPACE character in the workshop. This range is not complete.

  2. kunal-mohta commented on Feb 24, 2018

    @kunal-mohta
    Contributor

    @stebanos What other characters would be needed to be added in the range?

  3. stebanos commented on Feb 24, 2018

    @stebanos
    MemberAuthor

    I think it's these:
    https://stackoverflow.com/questions/6073637/javascript-regex-whitespace-characters

    charcodes:
    9, 10, 11, 12, 13, 32, 160, 8232, 8233

    Maybe there's more?

  4. kunal-mohta commented on Feb 24, 2018

    @kunal-mohta
    Contributor

    Okay so we got \t, \n, \v, \f, \r, " " for the first six ones.
    String.fromCharCode() gives " ", \u2028, \u2029 for the last three.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions