hedy
hedy copied to clipboard
[Content] make sure all blanks use the same symbol (and explain it!)
Blanks are not recognized on valid lines at levels 1-3:
This is the opposite of bug #2359, because here the syntax highlighting is not applied, but the interpreter considers that YES, it should be colored (while in the case of bug #2359, it considers that the # should not be colored)
As a result, the previous code, which is not excutable, cannot give the following result
Hi @thjazi39! Thank you for your interests and all the issues you've opened! Regarding this one the current implementation doesn't allow to print blanks, not even on further levels. We preprocess blanks before they're fed to the transpiler (the program that makes Hedy code Python code). Maybe a solution to this is to not detect blanks that are inside a print? But this still leaves the issue that at levels 1-3 we can't distinguish string and vars, so maybe in this case this is actually what we want: you can't print blanks because blanks mean that you need to fill in some code there.
Hi both!
I would say the highlighter is ok as it is, I consider this a content issue, we are content creators can make sure we don't use blank in that way, kids will never type blanks anyway (of they do, they don't mean them as blanks!)
Ok, so in that case, I have to correct the syntax highlighting so that the blanks are highlighted? (so that the kids understand where the error comes from)
Ok, so in that case, I have to correct the syntax highlighting so that the blanks are highlighted? (so that the kids understand where the error comes from)
No, leave this one for now. As I said I consider it a content issue.
The other changes to the highlighter (less overcoloring) are a lot more important, focus on those first
Just a note to self, currently, both _ and ? are highlighted as blanks:

So the issue that remains here is to make sure:
- All locations use the same blank and
- Explain what it means to users
I feel the same way, this is not a bug it's a feauture!
On Wed, Mar 30, 2022, 2:30 PM Felienne @.***> wrote:
Hi both!
I would say the highlighter is ok as it is, I consider this a content issue, we are content creators can make sure we don't use blank in that way, kids will never type blanks anyway (of they do, they don't mean them as blanks!)
— Reply to this email directly, view it on GitHub https://github.com/Felienne/hedy/issues/2380#issuecomment-1083477130, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK55RYOLPJIRDGB3LSCU3ADVCSMS7ANCNFSM5SCM75BA . You are receiving this because you commented.Message ID: @.***>
Just a note to self, currently, both _ and ? are highlighted as blanks:
it's not exactly that, currently only : (^| )(_)(?= |$)
and _?_
are recognized
-
we need to escape the question mark because it is a symbol used in regex : https://github.com/Felienne/hedy/blob/ff751661c8457d4ba020e45534b6d720f3b56e61/highlighting/rules_list.py#L34
-
the underscore will be recognized only if there is a space on each side (with cases for the beginning and end of lines) : https://github.com/Felienne/hedy/blob/ff751661c8457d4ba020e45534b6d720f3b56e61/highlighting/rules_list.py#L35
Thus the following strings will not be recognized:
e_e
e_
_e
?_
_?
?
_ # with insecable space
Note that, in the first 4 levels, because the syntactic highlighting paradigm being different, there are possible interactions with other rules, which can create bugs like this
Hi @MarleenGilsing!
This seems to be a good one for you. Some places use _
but sometimes in quizzes we also use _?_
. It would be nice if we make that the same everywhere. Will be a bit of a boring "checklist" task, sorry :)