Skip to content

Conversation

ianb
Copy link

@ianb ianb commented Jun 3, 2024

The first commit (39c932d) in this PR applies @simonwo's patches from #465 (comment)

I suppose this is a PR for discussion, because I don't personally understand @simonwo's changes but I did find them necessary when writing a whitespace-sensitive grammar.

The second commit (454746e) ignores blank lines when calculating indents and dedents, fixing a case like this:

if a:
  b

  c

Previously this would make a stream like if a:\n <indent>b\n<dedent>\n <indent>c\n but after it makes a stream if a:\n <indent>b\n\n c\n

ianb added 2 commits May 31, 2024 13:03
See ohmjs#465 (comment)

This changes memoization some so it can consume dedents
… as an indent or dedent

This is a case like:

if foo:
  bar()

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant