Fix various syntactic problems

This commit is contained in:
Atermonera
2020-01-20 22:05:25 -08:00
committed by VirgoBot
parent c877f3d265
commit 5bcb9cc934
25 changed files with 72 additions and 59 deletions

View File

@@ -153,8 +153,7 @@
start - The character used to start the string.
*/
ReadString(start)
var
buf
var/buf
for(, codepos <= length(code), codepos++)//codepos to length(code))
var/char=copytext(code, codepos, codepos+1)
switch(char)
@@ -189,9 +188,8 @@
Reads characters separated by an item in <delim> into a token.
*/
ReadWord()
var
char=copytext(code, codepos, codepos+1)
buf
var/char=copytext(code, codepos, codepos+1)
var/buf
while(!delim.Find(char) && codepos<=length(code))
buf+=char
char=copytext(code, ++codepos, codepos+1)
@@ -206,9 +204,8 @@
Reads a symbol into a token.
*/
ReadSymbol()
var
char=copytext(code, codepos, codepos+1)
buf
var/char=copytext(code, codepos, codepos+1)
var/buf
while(options.symbols.Find(buf+char))
buf+=char
@@ -223,10 +220,9 @@
Reads a number into a token.
*/
ReadNumber()
var
char=copytext(code, codepos, codepos+1)
buf
dec=0
var/char=copytext(code, codepos, codepos+1)
var/buf
var/dec=0
while(options.IsDigit(char) || (char=="." && !dec))
if(char==".") dec=1
@@ -246,14 +242,13 @@
*/
ReadComment()
var
char=copytext(code, codepos, codepos+1)
nextchar=copytext(code, codepos+1, codepos+2)
charstring = char+nextchar
comm = 1
// 1: single-line comment
// 2: multi-line comment
expectedend = 0
var/char=copytext(code, codepos, codepos+1)
var/nextchar=copytext(code, codepos+1, codepos+2)
var/charstring = char+nextchar
var/comm = 1
// 1: single-line comment
// 2: multi-line comment
var/expectedend = 0
if(charstring == "//" || charstring == "/*")
if(charstring == "/*")