Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of expression types #7

Open
wants to merge 3 commits into
base: tarcv-master
Choose a base branch
from
Open

Fix handling of expression types #7

wants to merge 3 commits into from

Conversation

TarCV
Copy link
Owner

@TarCV TarCV commented Apr 21, 2019

Fix handling of expression types

Additional fixes for CI:

  • Partially fix reporting position of an error

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Switched to branch fixes3, also tested against tarcv-master, which results in the same outcome.

Expression expr (this, m_lexer, TYPE_ToBeDecided);
ASSERT_NE(expr.getResult()->valueType(), TYPE_ToBeDecided)
if (expr.getResult()->valueType() != reqtype) {
error("Incompatible data type");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error: crashbot.botc:64:near 51: Incompatible data type
if (ChatSectionExistsInChatLump("WinStrings")) {

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try botc_defs.bts from this branch. 1060356 requires if "argument" to be boolean. (This is what Java does and I think such behavior is more friendly to Doom modders)
When an actual int returning function is used as if argument, you need to rewrite it like if (func() != 0).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something I noticed, although I don't know if you would consider it a bug. The compiler complains if the logical operator is used in an int (let's suppose it is named $local1) like $local1 = !($local1). Still converting the source code for the new defs, so far no real issues.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It compiled and works with the Roam() fix, here is the script I've used http://sprunge.us/v4r7jN.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant