standard_loader
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | standard_loader [2006/09/05 16:56] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======Synopsis: | ||
+ | [[load]] -std < | ||
+ | |||
+ | ======Description: | ||
+ | The //standard loader// converts a text file into a sequence of [[block]]s | ||
+ | which are executed one after another until the text file has been exhausted. | ||
+ | |||
+ | The //standard loader//s behavior does not follow the normal [[ircii syntax]], | ||
+ | and many people confuse the behavior of the loader with the behavior of ircii. | ||
+ | Because of this, newcomers are easily confounded, and for no good purpose. | ||
+ | |||
+ | The standard loader works by using an accumulator to build up [[block|blocks]] | ||
+ | and then runs them when they are completed. | ||
+ | |||
+ | - A logical line is read in from the file | ||
+ | * A physical line is read from the file, and leading whitespace is ignored | ||
+ | * If the line starts with # it is ignored | ||
+ | * If the line ends with a backslash, the next line is appended to the logical line, and whitespace is not ignored and # is not a comment character. | ||
+ | - Append this logical line to the accumulator. | ||
+ | - If the accumulator starts with /* [a comment], remove everything up to the matching */. If there is no matching */, keep accumulating. | ||
+ | - If there is an unmatched { in the accumulator, | ||
+ | - If the first character of the next line is {, do not append a semicolon, but keep accumulating. | ||
+ | - Eventually you get an accumulator with no unmatched {' | ||
+ | |||
+ | Repeat this process until the file is exhausted. | ||
+ | description is it is only // | ||
+ | weird edge cases that don't obey the above rules. | ||
+ | and proper explanation of the standard loader would have to involve profanity. | ||
+ | So I won't do that here. | ||
+ | |||
+ | The reason the std loader confuses new users is because it has its own syntax | ||
+ | which is not the ircII syntax, and it rewrites your script behind your back to | ||
+ | conform to ircII syntax. | ||
+ | stuff in ircII syntax, you don't know what rules apply where. | ||
+ | loader lamely puts semicolons on the end of **every** line, and there' | ||
+ | to make it not do this if you don't want it done. | ||
+ | |||
+ | The solution to these problems is to use the [[pf loader]] which | ||
+ | treats your entire file as one gigantic block and runs it without processing. | ||
+ | This, at least, means you write your scripts in standard [[ircii syntax]], | ||
+ | and doesn' | ||
+ | |||
+ | All of the scripts that come with epic5 are in the pf format, and the std | ||
+ | loader should die the quick and painful death it so richly deserves. | ||
+ | |||
standard_loader.txt · Last modified: 2006/09/05 16:56 by 127.0.0.1