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

5
SpacemanDMM.toml Normal file
View File

@@ -0,0 +1,5 @@
[diagnostics]
macro_redefined = "off"
macro_undefined_no_definition = "off"
as_local_var = "off"
tmp_no_effect = "off"

View File

@@ -144,9 +144,8 @@ Class Procs:
merge(A.zone,B.zone) merge(A.zone,B.zone)
return return
var var/a_to_b = get_dir(A,B)
a_to_b = get_dir(A,B) var/b_to_a = get_dir(B,A)
b_to_a = get_dir(B,A)
if(!A.connections) A.connections = new if(!A.connections) A.connections = new
if(!B.connections) B.connections = new if(!B.connections) B.connections = new

View File

@@ -6,8 +6,8 @@
#define RETURN_PRECISE_POSITION(A) new /datum/position(A) #define RETURN_PRECISE_POSITION(A) new /datum/position(A)
#define RETURN_PRECISE_POINT(A) new /datum/point(A) #define RETURN_PRECISE_POINT(A) new /datum/point(A)
#define RETURN_POINT_VECTOR(ATOM, ANGLE, SPEED) {new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED)} #define RETURN_POINT_VECTOR(ATOM, ANGLE, SPEED) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED))
#define RETURN_POINT_VECTOR_INCREMENT(ATOM, ANGLE, SPEED, AMT) {new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED, AMT)} #define RETURN_POINT_VECTOR_INCREMENT(ATOM, ANGLE, SPEED, AMT) (new /datum/point/vector(ATOM, null, null, null, null, ANGLE, SPEED, AMT))
/datum/position //For positions with map x/y/z and pixel x/y so you don't have to return lists. Could use addition/subtraction in the future I guess. /datum/position //For positions with map x/y/z and pixel x/y so you don't have to return lists. Could use addition/subtraction in the future I guess.
var/x = 0 var/x = 0

View File

@@ -298,7 +298,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(CHANNEL.is_admin_channel) if(CHANNEL.is_admin_channel)
dat+="<B><FONT style='BACKGROUND-COLOR: LightGreen '><A href='?src=\ref[src];show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A></FONT></B><BR>" dat+="<B><FONT style='BACKGROUND-COLOR: LightGreen '><A href='?src=\ref[src];show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A></FONT></B><BR>"
else else
dat+="<B><A href='?src=\ref[src];show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR></B>" dat+="<B><A href='?src=\ref[src];show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR></B>"
dat+="<BR><HR><A href='?src=\ref[src];refresh=1'>Refresh</A>" dat+="<BR><HR><A href='?src=\ref[src];refresh=1'>Refresh</A>"
dat+="<BR><A href='?src=\ref[src];setScreen=[0]'>Back</A>" dat+="<BR><A href='?src=\ref[src];setScreen=[0]'>Back</A>"
if(2) if(2)
@@ -396,7 +396,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="<I>No feed channels found active...</I><BR>" dat+="<I>No feed channels found active...</I><BR>"
else else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels) for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
dat+="<A href='?src=\ref[src];pick_censor_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR>" dat+="<A href='?src=\ref[src];pick_censor_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR>"
dat+="<BR><A href='?src=\ref[src];setScreen=[0]'>Cancel</A>" dat+="<BR><A href='?src=\ref[src];setScreen=[0]'>Cancel</A>"
if(11) if(11)
dat+="<B>[using_map.company_name] D-Notice Handler</B><HR>" dat+="<B>[using_map.company_name] D-Notice Handler</B><HR>"
@@ -407,7 +407,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="<I>No feed channels found active...</I><BR>" dat+="<I>No feed channels found active...</I><BR>"
else else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels) for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
dat+="<A href='?src=\ref[src];pick_d_notice=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR>" dat+="<A href='?src=\ref[src];pick_d_notice=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR>"
dat+="<BR><A href='?src=\ref[src];setScreen=[0]'>Back</A>" dat+="<BR><A href='?src=\ref[src];setScreen=[0]'>Back</A>"
if(12) if(12)

View File

@@ -138,7 +138,7 @@
/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob) /turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob)
user.setClickCooldown(user.get_attack_speed(W)) user.setClickCooldown(user.get_attack_speed(W))
if (!user.) if (!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>") to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return return

View File

@@ -369,7 +369,7 @@ proc/admin_notice(var/message, var/rights)
if(CHANNEL.is_admin_channel) if(CHANNEL.is_admin_channel)
dat+="<B><FONT style='BACKGROUND-COLOR: LightGreen'><A href='?src=\ref[src];ac_show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A></FONT></B><BR>" dat+="<B><FONT style='BACKGROUND-COLOR: LightGreen'><A href='?src=\ref[src];ac_show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A></FONT></B><BR>"
else else
dat+="<B><A href='?src=\ref[src];ac_show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR></B>" dat+="<B><A href='?src=\ref[src];ac_show_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR></B>"
dat+={"<BR><HR><A href='?src=\ref[src];ac_refresh=1'>Refresh</A> dat+={"<BR><HR><A href='?src=\ref[src];ac_refresh=1'>Refresh</A>
<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Back</A> <BR><A href='?src=\ref[src];ac_setScreen=[0]'>Back</A>
"} "}
@@ -453,7 +453,7 @@ proc/admin_notice(var/message, var/rights)
dat+="<I>No feed channels found active...</I><BR>" dat+="<I>No feed channels found active...</I><BR>"
else else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels) for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
dat+="<A href='?src=\ref[src];ac_pick_censor_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR>" dat+="<A href='?src=\ref[src];ac_pick_censor_channel=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR>"
dat+="<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Cancel</A>" dat+="<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Cancel</A>"
if(11) if(11)
dat+={" dat+={"
@@ -466,7 +466,7 @@ proc/admin_notice(var/message, var/rights)
dat+="<I>No feed channels found active...</I><BR>" dat+="<I>No feed channels found active...</I><BR>"
else else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels) for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
dat+="<A href='?src=\ref[src];ac_pick_d_notice=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : ()]<BR>" dat+="<A href='?src=\ref[src];ac_pick_d_notice=\ref[CHANNEL]'>[CHANNEL.channel_name]</A> [(CHANNEL.censored) ? ("<FONT COLOR='red'>***</FONT>") : null]<BR>"
dat+="<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Back</A>" dat+="<BR><A href='?src=\ref[src];ac_setScreen=[0]'>Back</A>"
if(12) if(12)
@@ -1223,7 +1223,7 @@ var/datum/announcement/minor/admin_min_announcer = new
out += "<b>Autotraitor <a href='?src=\ref[ticker.mode];toggle=autotraitor'>disabled</a></b>.<br/>" out += "<b>Autotraitor <a href='?src=\ref[ticker.mode];toggle=autotraitor'>disabled</a></b>.<br/>"
out += "<b>All antag ids:</b>" out += "<b>All antag ids:</b>"
if(ticker.mode.antag_templates && ticker.mode.antag_templates.len). if(ticker.mode.antag_templates && ticker.mode.antag_templates.len)
for(var/datum/antagonist/antag in ticker.mode.antag_templates) for(var/datum/antagonist/antag in ticker.mode.antag_templates)
antag.update_current_antag_max() antag.update_current_antag_max()
out += " <a href='?src=\ref[ticker.mode];debug_antag=[antag.id]'>[antag.id]</a>" out += " <a href='?src=\ref[ticker.mode];debug_antag=[antag.id]'>[antag.id]</a>"
@@ -1532,9 +1532,8 @@ datum/admins/var/obj/item/weapon/paper/admin/faxreply // var to hold fax replies
P.stamps += "<hr><i>This paper has been stamped by the [P.origin] Quantum Relay.</i>" P.stamps += "<hr><i>This paper has been stamped by the [P.origin] Quantum Relay.</i>"
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
var/{x; y;} var/x = rand(-2, 0)
x = rand(-2, 0) var/y = rand(-1, 2)
y = rand(-1, 2)
P.offset_x += x P.offset_x += x
P.offset_y += y P.offset_y += y
stampoverlay.pixel_x = x stampoverlay.pixel_x = x

View File

@@ -28,10 +28,14 @@ var/datum/admin_secrets/admin_secrets = new()
/datum/admin_secret_category /datum/admin_secret_category
var/name = "" var/name = ""
var/desc = "" var/desc = ""
<<<<<<< HEAD
var/list/datum/admin_secret_item/items var/list/datum/admin_secret_item/items
/datum/admin_secret_category /datum/admin_secret_category
items = list() items = list()
=======
var/list/datum/admin_secret_item/items = list()
>>>>>>> 9684db1... Merge pull request #6636 from SpaceManiac/patch/syntax
/datum/admin_secret_category/proc/can_view(var/mob/user) /datum/admin_secret_category/proc/can_view(var/mob/user)
for(var/datum/admin_secret_item/item in items) for(var/datum/admin_secret_item/item in items)

View File

@@ -99,7 +99,10 @@
slot_l_hand_str = "engiewelding", slot_l_hand_str = "engiewelding",
slot_r_hand_str = "engiewelding", slot_r_hand_str = "engiewelding",
) )
<<<<<<< HEAD
=======
>>>>>>> 9684db1... Merge pull request #6636 from SpaceManiac/patch/syntax
/* /*
* Cakehat * Cakehat

View File

@@ -106,7 +106,10 @@
/obj/item/rig_module/self_destruct /obj/item/rig_module/self_destruct
) )
<<<<<<< HEAD
=======
>>>>>>> 9684db1... Merge pull request #6636 from SpaceManiac/patch/syntax
/obj/item/clothing/gloves/gauntlets/rig/light/ninja /obj/item/clothing/gloves/gauntlets/rig/light/ninja
name = "insulated gloves" name = "insulated gloves"
siemens_coefficient = 0 siemens_coefficient = 0

View File

@@ -536,4 +536,8 @@
account_to_connect = "Cargo" account_to_connect = "Cargo"
/obj/machinery/cash_register/civilian /obj/machinery/cash_register/civilian
<<<<<<< HEAD
account_to_connect = "Civilian" account_to_connect = "Civilian"
=======
account_to_connect = "Civilian"
>>>>>>> 9684db1... Merge pull request #6636 from SpaceManiac/patch/syntax

View File

@@ -418,4 +418,8 @@
account_to_connect = "Cargo" account_to_connect = "Cargo"
/obj/item/device/retail_scanner/civilian /obj/item/device/retail_scanner/civilian
<<<<<<< HEAD
account_to_connect = "Civilian" account_to_connect = "Civilian"
=======
account_to_connect = "Civilian"
>>>>>>> 9684db1... Merge pull request #6636 from SpaceManiac/patch/syntax

View File

@@ -66,9 +66,8 @@ proc/Ellipsis(original_msg, chance = 50)
if(chance <= 0) return "..." if(chance <= 0) return "..."
if(chance >= 100) return original_msg if(chance >= 100) return original_msg
var/list var/list/words = splittext(original_msg," ")
words = splittext(original_msg," ") var/list/new_words = list()
new_words = list()
var/new_msg = "" var/new_msg = ""

View File

@@ -377,7 +377,7 @@
return return
// Check if we should even bother working on the current seed datum. // Check if we should even bother working on the current seed datum.
if(seed.mutants. && seed.mutants.len && severity > 1) if(seed.mutants && seed.mutants.len && severity > 1)
mutate_species() mutate_species()
return return

View File

@@ -297,7 +297,7 @@
user << browse(dat + "<html><head><title>[P.name]</title></head>" \ user << browse(dat + "<html><head><title>[P.name]</title></head>" \
+ "<body style='overflow:hidden'>" \ + "<body style='overflow:hidden'>" \
+ "<div> <img src='tmp_photo.png' width = '180'" \ + "<div> <img src='tmp_photo.png' width = '180'" \
+ "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : ]"\ + "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : null]"\
+ "</body></html>", "window=[name]") + "</body></html>", "window=[name]")
else if(!isnull(pages[page])) else if(!isnull(pages[page]))
if(!(istype(usr, /mob/living/carbon/human) || isobserver(usr) || istype(usr, /mob/living/silicon))) if(!(istype(usr, /mob/living/carbon/human) || isobserver(usr) || istype(usr, /mob/living/silicon)))

View File

@@ -1186,7 +1186,7 @@
if(LAZYLEN(species.descriptors)) if(LAZYLEN(species.descriptors))
descriptors = list() descriptors = list()
for(var/desctype in species.descriptors) for(var/desctype in species.descriptors)
var/datum/mob_descriptor.descriptor = species.descriptors[desctype] var/datum/mob_descriptor/descriptor = species.descriptors[desctype]
descriptors[desctype] = descriptor.default_value descriptors[desctype] = descriptor.default_value
spawn(0) spawn(0)

View File

@@ -104,7 +104,7 @@
if("corrupted") // Load them up with ion laws. if("corrupted") // Load them up with ion laws.
var/datum/ai_laws/laws = new() // Start with an empty lawset. var/datum/ai_laws/laws = new() // Start with an empty lawset.
for(1 to rand(1, 3)) for(var/i in 1 to rand(1, 3))
laws.add_ion_law(generate_ion_law(exclude_crew_names = TRUE)) laws.add_ion_law(generate_ion_law(exclude_crew_names = TRUE))
return laws return laws

View File

@@ -269,7 +269,7 @@
return FALSE return FALSE
var/turf/below = GetBelow(src) var/turf/below = GetBelow(src)
if((locate(/obj/structure/disposalpipe/up) in below) || locate(/obj/machinery/atmospherics/pipe/zpipe/up in below)) if((locate(/obj/structure/disposalpipe/up) in below) || locate(/obj/machinery/atmospherics/pipe/zpipe/up) in below)
return FALSE return FALSE
/mob/living/can_fall() /mob/living/can_fall()

View File

@@ -546,7 +546,7 @@
stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>" stamps += (stamps=="" ? "<HR>" : "<BR>") + "<i>This paper has been stamped with the [P.name].</i>"
var/image/stampoverlay = image('icons/obj/bureaucracy.dmi') var/image/stampoverlay = image('icons/obj/bureaucracy.dmi')
var/{x; y;} var/x, y
if(istype(P, /obj/item/weapon/stamp/captain) || istype(P, /obj/item/weapon/stamp/centcomm)) if(istype(P, /obj/item/weapon/stamp/captain) || istype(P, /obj/item/weapon/stamp/centcomm))
x = rand(-2, 0) x = rand(-2, 0)
y = rand(-1, 2) y = rand(-1, 2)

View File

@@ -134,7 +134,7 @@
user << browse(dat + "<html><head><title>[P.name]</title></head>" \ user << browse(dat + "<html><head><title>[P.name]</title></head>" \
+ "<body style='overflow:hidden'>" \ + "<body style='overflow:hidden'>" \
+ "<div> <img src='tmp_photo.png' width = '180'" \ + "<div> <img src='tmp_photo.png' width = '180'" \
+ "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : ]"\ + "[P.scribble ? "<div> Written on the back:<br><i>[P.scribble]</i>" : null]"\
+ "</body></html>", "window=[name]") + "</body></html>", "window=[name]")
/obj/item/weapon/paper_bundle/attack_self(mob/user as mob) /obj/item/weapon/paper_bundle/attack_self(mob/user as mob)

View File

@@ -1184,7 +1184,7 @@
// defines a state machine, returns the new state // defines a state machine, returns the new state
obj/machinery/power/apc/proc/autoset(var/cur_state, var/on) obj/machinery/power/apc/proc/autoset(var/cur_state, var/on)
switch(cur_state) switch(cur_state)
if(POWERCHAN_OFF); //autoset will never turn on a channel set to off //if(POWERCHAN_OFF); //autoset will never turn on a channel set to off
if(POWERCHAN_OFF_AUTO) if(POWERCHAN_OFF_AUTO)
if(on == 1) if(on == 1)
return POWERCHAN_ON_AUTO return POWERCHAN_ON_AUTO

View File

@@ -393,7 +393,7 @@ won't update every console in existence) but it's more of a hassle to do. Also,
var/obj/item/weapon/paper/PR = new/obj/item/weapon/paper var/obj/item/weapon/paper/PR = new/obj/item/weapon/paper
PR.name = "list of researched technologies" PR.name = "list of researched technologies"
PR.info = "<center><b>[station_name()] Science Laboratories</b>" PR.info = "<center><b>[station_name()] Science Laboratories</b>"
PR.info += "<h2>[ (text2num(href_list["print"]) == 2) ? "Detailed" : ] Research Progress Report</h2>" PR.info += "<h2>[ (text2num(href_list["print"]) == 2) ? "Detailed" : null] Research Progress Report</h2>"
PR.info += "<i>report prepared at [stationtime2text()] station time</i></center><br>" PR.info += "<i>report prepared at [stationtime2text()] station time</i></center><br>"
if(text2num(href_list["print"]) == 2) if(text2num(href_list["print"]) == 2)
PR.info += GetResearchListInfo() PR.info += GetResearchListInfo()

View File

@@ -53,10 +53,9 @@
if(/token/word) if(/token/word)
return new/node/expression/value/variable(T.value) return new/node/expression/value/variable(T.value)
if(/token/accessor) if(/token/accessor)
var var/token/accessor/A=T
token/accessor/A=T var/node/expression/value/variable/E//=new(A.member)
node/expression/value/variable/E//=new(A.member) var/stack/S=new()
stack/S=new()
while(istype(A.object, /token/accessor)) while(istype(A.object, /token/accessor))
S.Push(A) S.Push(A)
A=A.object A=A.object
@@ -181,11 +180,10 @@
- <ParseParamExpression()> - <ParseParamExpression()>
*/ */
ParseExpression(list/end=list(/token/end), list/ErrChars=list("{", "}")) ParseExpression(list/end=list(/token/end), list/ErrChars=list("{", "}"))
var/stack var/stack/opr=new
opr=new var/stack/val=new
val=new
src.expecting=VALUE src.expecting=VALUE
for() while(TRUE)
if(EndOfExpression(end)) if(EndOfExpression(end))
break break
if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value)) if(istype(curToken, /token/symbol) && ErrChars.Find(curToken.value))
@@ -278,7 +276,7 @@
NextToken() //skip open parenthesis, already found NextToken() //skip open parenthesis, already found
var/loops = 0 var/loops = 0
for() while(TRUE)
loops++ loops++
if(loops>=1000) if(loops>=1000)
CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;") CRASH("Something TERRIBLE has gone wrong in ParseFunctionExpression ;__;")

View File

@@ -134,7 +134,7 @@ var/const/Represents a special statement in the code triggered by a keyword.
parser.NextToken() parser.NextToken()
if(!parser.CheckToken("(", /token/symbol)) if(!parser.CheckToken("(", /token/symbol))
return KW_FAIL return KW_FAIL
for() //for now parameters can be separated by whitespace - they don't need a comma in between while(TRUE) //for now parameters can be separated by whitespace - they don't need a comma in between
if(istype(parser.curToken, /token/symbol)) if(istype(parser.curToken, /token/symbol))
switch(parser.curToken.value) switch(parser.curToken.value)
if(",") if(",")

View File

@@ -172,7 +172,7 @@
if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis if(!CheckToken("(", /token/symbol)) //Check for and skip open parenthesis
return return
var/loops = 0 var/loops = 0
for() while(TRUE)
loops++ loops++
if(loops>=6000) if(loops>=6000)
CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;") CRASH("Something TERRIBLE has gone wrong in ParseFunctionStatement ;__;")

View File

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