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

Lines should not contain multiple statements #10

Open
Holt59 opened this issue Nov 10, 2020 · 0 comments
Open

Lines should not contain multiple statements #10

Holt59 opened this issue Nov 10, 2020 · 0 comments

Comments

@Holt59
Copy link

Holt59 commented Nov 10, 2020

The grammar allows multiple statements on each line, which is not what is specified in the "Technical README". Since Wrye Bash is kind of lazy regarding using variables that have not been defined yet, this can make stuff really hard to interpreter. For instance, this line that should throw an error (from You can get this one Nexus: https://www.nexusmods.com/skyrimspecialedition/mods/38857):

If something is wrong with this line of script. \n Note "Something " EndIf

Matches the ifStmt rule, but:

  • something is a valid expression for Wrye Bash, it simply evaluates to 0 (from my testing).
  • is wrong with this line of is actually a valid body, each word being an expression with value 0 (undefined variables).
  • the first issue is script. because the . is not valid in identifier, thus making it a DotFunctionCall, that fails due to the \n right after.

Edit: So actually Wrye Bash allow multiple things on one line since the error here would be:

An error occurred in the wizard script:
Line 192:	If something is wrong with this line of script. \n Note "Something definitely got borked. Hmmm" \n                           Else Consult a scripting grimoire | the wise man on the mountain | a magical wizard or a guru that goes by the handle of 'Lojack' | maybe even a monkey, but definitely NOT Metalio Bovinus because he is utterly incapable of writing custum scriptz; \n EndIf
Error:	(Line 192, Column 381): Dot operator: cannot access non-function 'n'

I'm keeping this open as a reference to update the technical README.

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

No branches or pull requests

1 participant