InfixCheckLineSpaced (lines 274-362)
Back to List
Browsing infix.h
0274 [ InfixCheckLineSpaced wa wl i force altered;
0275 for (i = 1 : i <= parse->1 : i++)
0276 { wa = WordAddress(i);
0277 wl = WordLength(i);
0278 if (wl > 3 && wa->0==''' && wa->(wl-1)==''')
0279 { wa->(wl-1) = ' ';
0280 if (wa->(wl-2) == '/' && wa->(wl-3) == '/')
0281 { wa->(wl-2) = ' ';
0282 wa->(wl-3) = ' ';
0283 }
0284 LTI_Insert(wa-buffer, ''');
0285 LTI_Insert(wa-buffer + 2, ' ');
0286 altered = true; break;
0287 }
0288 }
0289 for (i = 2 : i < buffer->1 + 2: i++)
0290 { force = false;
0291 if (buffer->i=='-' && buffer->(i+1)=='-' && buffer->(i+2)=='>')
0292 force = true;
0293 if (force)
0294 { if (i>2 && buffer->(i-1)~=' ')
0295 { LTI_Insert(i++, ' '); altered = true;
0296 }
0297 if (buffer->(i+3)~=' ')
0298 { LTI_Insert(i+3, ' '); i++; altered = true;
0299 }
0300 i = i + 2; continue;
0301 }
0302
0303 if (buffer->i==':' && buffer->(i+1)==':') force = true;
0304 if (buffer->i=='-' && buffer->(i+1)=='>') force = true;
0305 if (buffer->i=='.' && buffer->(i+1)=='&')
0306 { buffer->i = ']'; force = true;
0307 }
0308 if (buffer->i=='.' && buffer->(i+1)=='#')
0309 { buffer->i = ']'; force = true;
0310 }
0311 if (buffer->i==']' && buffer->(i+1)=='&') force = true;
0312 if (buffer->i==']' && buffer->(i+1)=='#') force = true;
0313 if (buffer->i=='+' && buffer->(i+1)=='+') force = true;
0314 if (buffer->i=='-' && buffer->(i+1)=='-') force = true;
0315 if (buffer->i=='&' && buffer->(i+1)=='&') force = true;
0316 if (buffer->i=='|' && buffer->(i+1)=='|') force = true;
0317 if (buffer->i=='~' && buffer->(i+1)=='~') force = true;
0318
0319 if (buffer->i=='=' && buffer->(i+1)=='=') force = true;
0320 if (buffer->i=='~' && buffer->(i+1)=='=') force = true;
0321 if (buffer->i=='>' && buffer->(i+1)=='=') force = true;
0322 if (buffer->i=='<' && buffer->(i+1)=='=') force = true;
0323 if (buffer->i=='#' && buffer->(i+1)=='#') force = true;
0324
0325 if (force)
0326 { if (i>2 && buffer->(i-1)~=' ')
0327 { LTI_Insert(i++, ' '); altered = true;
0328 }
0329 if (buffer->(i+2)~=' ')
0330 { LTI_Insert(i+2, ' '); i++; altered = true;
0331 }
0332 i = i + 1; continue;
0333 }
0334
0335 if (buffer->i=='+') force = true;
0336 if (buffer->i=='-') force = true;
0337 if (buffer->i=='*') force = true;
0338 if (buffer->i=='/') force = true;
0339 if (buffer->i=='%') force = true;
0340 if (buffer->i=='(') force = true;
0341 if (buffer->i==')') force = true;
0342 if (buffer->i=='<' && buffer->(i-1)~=';') force = true;
0343 if (buffer->i=='>') force = true;
0344 if (buffer->i==',') force = true;
0345 if (buffer->i=='.') force = true;
0346 if (buffer->i=='&') force = true;
0347 if (buffer->i=='|') force = true;
0348 if (buffer->i=='~') force = true;
0349 if (buffer->i=='=') force = true;
0350 if (force)
0351 { if (i>2 && buffer->(i-1)~=' ')
0352 { LTI_Insert(i++, ' '); altered = true;
0353 }
0354 if (buffer->(i+1)~=' ')
0355 { LTI_Insert(i+1, ' '); i++; altered = true;
0356 }
0357 }
0358 }
0359 for (i = 2 : i < buffer->1 + 2: i++)
0360 if (buffer->i == '~') { buffer->i = '['; altered = true; }
0361 return altered;
0362 ];
Last updated 27 February 2004.
This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation.
Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.