ID:2299408
 
Resolved
The operator keyword conflicted with older code such as the AbyssDragon.SET library. The word should once again be usable as a var name or path component.
BYOND Version:512.1386
Operating System:Windows 10 Home 64-bit
Web Browser:Firefox 56.0
Applies to:Dream Maker
Status: Resolved (512.1389)

This issue has been resolved.
Descriptive Problem Summary:
SET, which allows for numerical calculations through strings, is a very good library to have for text games. However, the latest Beta update does not let this library compile.

Numbered Steps to Reproduce Problem:
1. Download and include the library
2. Update to current beta version
3. Try to compile the code

Code Snippet (if applicable) to Reproduce Problem:
//this seems to be the proc that triggers the errors

SQRT
operate(list/symbols, position)
var/partner_pos = symbols.Find(partner)
var/Scalar/argument = a_Evaluate(symbols.Copy(position+1, partner_pos))
var/Scalar/exponent = new()
exponent.real = 1/2
var/insert[] = list(argument,new/operator/exponent,exponent)
return symbols.Copy(1, position) + insert + symbols.Copy(partner_pos+1, 0)


//Error messages:

loading test.dme
Documents\BYOND\lib\abyssdragon\set\functions.dm:51:error: exponent: missing comma ',' or right-paren ')'
Documents\BYOND\lib\abyssdragon\set\functions.dm:51:error: exponent: expected end of statement
Documents\BYOND\lib\abyssdragon\set\functions.dm:51:error: ,: expected }
Documents\BYOND\lib\abyssdragon\set\functions.dm:47:error: location of top-most unmatched {
test.dmb - 4 errors, 0 warnings (9/29/17 6:05 pm)



Expected Results:
Dream maker would compile without error
Actual Results:
Dream maker does not let the code compile

Does the problem occur:
Every time? Or how often? Every time
In other games?
In other user accounts?
On other computers?

When does the problem NOT occur?
By downgrading to the current stable version

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)

Workarounds:
Reverting to the current stable version of BYOND

Library in question: http://www.byond.com/developer/AbyssDragon/SET


Works on: 511.1385 (stable version)
No longer compiles on: 512.1386
What line is line 51?
Looks like "operator" (from operator overloading) is now one of those pseudo-reserved keywords that the compiler can't handle.
This post belongs in Beta Bugs and needs the correct version number. Please edit your report to include the correct and full version number, and I'll move it later.
Added version number
Works on: 511.1385 (stable version)
No longer compiles on: 512.1386

downloaded 512.1386 and it is indeed the version where this code stops compiling

here is line 51
                var/insert[] = list(argument,new/operator/exponent,exponent)


this is the line that seems to destroy everything
if i comment out that line and re-compile, then it complains about this:

//loading .dme
\Documents\BYOND\lib\abyssdragon\set\operators.dm:322:error: parenthesis: missing comma ',' or right-paren ')'
.dmb - 1 error, 0 warnings (9/29/17 7:46 pm)

if(current.type==/operator/parenthesis || istype(current, /operator/function)) count++


commenting out those lines leads to more and more similar errors...
as was said above, it's the /operator part.
operator is reserved by DM now for operator overloading.
rename the /operator datum to fix it.
I'll probably change this behavior. I just have to make some changes to the parser so it'll work as it used to.
Lummox JR resolved issue with message:
The operator keyword conflicted with older code such as the AbyssDragon.SET library. The word should once again be usable as a var name or path component.