about summary refs log tree commit diff stats
path: root/screen.mu
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-06-14 16:11:47 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-06-14 16:11:47 -0700
commit7fb3fccbb8f2a4b068a0e4bffa46a935e11db3a4 (patch)
treeefe99f8da8dc4f6e82cbd29c050f494cf832035f /screen.mu
parentb1bfd9213244d0da4c5d99ef3adcec121b041380 (diff)
downloadmu-7fb3fccbb8f2a4b068a0e4bffa46a935e11db3a4.tar.gz
1564 - a better way to support string literals
Our new heuristic is: all string literals are the same. If they contain
newline before non-whitespace, we scan for comments assuming there might
be code inside:

  foofoofoo [
    ...  # ']' inside comment ignored
  ]

If they contain non-whitespace first, then we ignore comments assuming
it's just a regular string:

  foofoofoo [abc#def]  # valid string literal

The big hole in this approach:

  foofoofoo [ # what about comments here containing ']'?
    ... # abc
  ]

Currently this reads as a 'code comment' and terminates before the
newline or '?' and will probably trigger errors down the line.
Temporary workaround: don't start code strings with a comment on the
same line as the '['. Eventually we'll tighten up the logic.

We're still not using the new heuristic in scenarios, but that's up
next.
Diffstat (limited to 'screen.mu')
0 files changed, 0 insertions, 0 deletions