Orvid / Caprica

A compiler for the Papyrus scripting language used by the Creation Engine.
MIT License
84 stars 15 forks source link

LegendaryItemQuestScript.psc fails to compile #6

Closed fireundubh closed 8 years ago

fireundubh commented 8 years ago
D:\Steam\steamapps\common\Fallout 4\Data\scripts\source\LegendaryItemQuestScript.psc(52,7):
    Fatal Error: Expected 'Identifier' got 'Continue'!

Looks like the error is related to:

bool continue = ListOfSpecificModsToDisallow.Find(ModToConsider as Form) <= -1

Does Caprica's Find() syntax match Champollion's?

CPULL commented 8 years ago

Caprica add some extensions to the Papyrus language, for example the "break" and "continue" statements for cycles. So this line of code, has not a correct syntax, because "continue" is a statement and cannot be a variable.

Orvid commented 8 years ago

CPULL is correct on this. If I remember correctly, that is the only use of Continue as an identifier, and I decided that using some other obscure identifier just so that I could compile the stock scripts would be terrible language design, especially considering I can't compile the stock scripts to begin with because Bethesda is doing things that aren't valid (one of the scripts has the same name for a property and a parameter to a function; that's not allowed, but they do it anyways) to begin with. There are also (multiple) places where Caprica can't compile the stock scripts because they declare that they are going to return a value and then don't actually do so.

In that error message, you'll notice that it points you to line 52, column 7, which is the start of continue. That message does however need to be labeled as a syntax error, because it's not very clear what the error is right now.

If you don't want to change it, you can always compile with --enable-language-extension false to disable Caprica's extensions to the language.