Opened 6 years ago

Closed 6 years ago

Last modified 2 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 Changed 6 years ago by s10k

  • Description modified (diff)
  • Summary changed from Display an error when an undeclared variable is used in BSL to Display an warning when an undeclared variable is used in BSL

comment:2 Changed 6 years ago by s10k

  • Summary changed from Display an warning when an undeclared variable is used in BSL to Display a warning when an undeclared variable is used in BSL

comment:3 Changed 6 years ago by s10k

  • Description modified (diff)

comment:4 Changed 6 years ago by Alloc

  • Owner changed from Alloc to Iritscen
  • Status changed from new to assigned

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

comment:5 Changed 6 years ago by Iritscen

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 Changed 6 years ago by Alloc

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 Changed 6 years ago by Iritscen

  • Resolution set to wontfix
  • Status changed from assigned to closed

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 Changed 2 years ago by Iritscen

  • Component changed from Daodan to Daodan/Win
Note: See TracTickets for help on using tickets.