You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I understand correctly, LoadStatement removes all spaces (' ' and '\t'), except those inside strings. For example, form -y converts
S x , y [ x y ] , , "[ x y ]";
.end
into
S,x,y,[,x,y,],,"[ x y ]"
This means compiler routines like Co* don't need to care about spaces.
But there are many snippets in them like:
SKIPBLANKS(s)
SKIPBLANKS(s);
while ( *s==' '||*s=='\t' ) s++;
and
while ( *s==','||*s=='\t'||*s==' ' ) s++;
while ( *s==','||*s==' '||*s=='\t' ) s++;
while ( *s&& ( *s==','||*s==' '||*s=='\t' ) ) s++;
For the last 3 variants, I also added a helper SkipSpaces(&s);.
Do we really need all these space-skipping checks? They look redundant and inefficient, and can be replaced with, say, SkipCommas(&s);. Or am I missing something?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
If I understand correctly,
LoadStatementremoves all spaces (' 'and'\t'), except those inside strings. For example,form -yconvertsinto
This means compiler routines like
Co*don't need to care about spaces.But there are many snippets in them like:
and
For the last 3 variants, I also added a helper
SkipSpaces(&s);.Do we really need all these space-skipping checks? They look redundant and inefficient, and can be replaced with, say,
SkipCommas(&s);. Or am I missing something?Beta Was this translation helpful? Give feedback.
All reactions