Opened 6 years ago

Closed 6 years ago

Last modified 3 years ago

#134 closed enhancement (wontfix)

Display a warning when an undeclared variable is used in BSL

Reported by: s10k Owned by: Iritscen
Priority: minor Component: Daodan/Win
Keywords: Cc:

Description (last modified by s10k)

It would very useful if instead of ignoring and causing silent issues, if the BSL parser could emit a warning when a variable that was not been declared is used.

How it is right now it raises a very hard to debug issue.

\Edit
Changed error to warning, because if we would emit an error, it could break existing scripts.

Change History (8)

comment:1 by s10k, 6 years ago

Description: modified (diff)
Summary: Display an error when an undeclared variable is used in BSLDisplay an warning when an undeclared variable is used in BSL

comment:2 by s10k, 6 years ago

Summary: Display an warning when an undeclared variable is used in BSLDisplay a warning when an undeclared variable is used in BSL

comment:3 by s10k, 6 years ago

Description: modified (diff)

comment:4 by Christian, 6 years ago

Owner: changed from Christian to Iritscen
Status: newassigned

Would need some technical input on how this is handled to see whether this is possible.

comment:5 by Iritscen, 6 years ago

To me, this is a job for a BSL validator, i.e., a program that you run on your code before giving it to Oni. I know there's been one or two attempts at making one, but as they were Windows-only I'm not sure how far they got.

The only way I can think of to implement the requested feature inside Oni is to have the Daodan DLL validate BSL when a level loads, which seems like the wrong time and place to perform a task that could be done in advance by an external program.

comment:6 by Christian, 6 years ago

Well, the question would be if the parser already had a code that checks for a variable name it finds in the code and if that thing currently silently ignored that line or something like that so we could add a message output there. But I have really no idea how the Oni's BSL parser is designed :)

comment:7 by Iritscen, 6 years ago

Resolution: wontfix
Status: assignedclosed

I think that if Oni had the ability to recognize undeclared variables, it would already be warning us. As far as I know, this is just another example of BSL being half-baked. That's why I'd recommend a validator instead.

comment:8 by Iritscen, 3 years ago

Component: DaodanDaodan/Win
Note: See TracTickets for help on using tickets.