Reserved Words: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Heeheehee
m Added try/finally, added link to relevant file in source code.
→‎Complex types: Added new ones
 
(3 intermediate revisions by 3 users not shown)
Line 34: Line 34:
*"default"
*"default"
*"try"
*"try"
*"catch"
*"finally"
*"finally"
*"static"


==Data types==
==Data types==
===Primitive types===
*"void"
*"void"
*"boolean"
*"boolean"
Line 45: Line 48:
*"matcher"
*"matcher"
*"aggregate"
*"aggregate"
===Complex types===
*"item"
*"item"
*"location"
*"location"
Line 55: Line 60:
*"monster"
*"monster"
*"element"
*"element"
*"coinmaster"
*"phylum"
*"thrall"
*"bounty"
*"servant"
*"vykea"
*"path"
=== Miscellaneous ===
*"record"
*"record"
*"typedef"
*"typedef"


==More Information==
==More Information==
[http://kolmafia.svn.sourceforge.net/viewvc/kolmafia/src/net/sourceforge/kolmafia/textui/Parser.java?view=markup This particular page] contains the most up-to-date version of this list around line 272.
The file [https://github.com/kolmafia/kolmafia/blob/main/src/net/sourceforge/kolmafia/textui/Parser.java <code>Parser.java</code>] contains the most up-to-date version of this list.
[[Category:Scripting]]
[[Category:Scripting]]

Latest revision as of 00:54, 1 May 2023

Following is a list of words that are reserved for special usage by KoLmafia. They can not be used as variable or function names.

They are listed by category for ease of reference; the category names are not reserved words, themselves (though using them as variables would be considered poor practice in most cases).

Constants

  • "true"
  • "false"

Operators

  • "contains"
  • "remove"
  • "new"

Control flow

  • "if"
  • "else"
  • "foreach"
  • "in"
  • "for"
  • "from"
  • "upto"
  • "downto"
  • "by"
  • "while"
  • "repeat"
  • "until"
  • "break"
  • "continue"
  • "return"
  • "exit"
  • "switch"
  • "case"
  • "default"
  • "try"
  • "catch"
  • "finally"
  • "static"

Data types

Primitive types

  • "void"
  • "boolean"
  • "int"
  • "float"
  • "string"
  • "buffer"
  • "matcher"
  • "aggregate"

Complex types

  • "item"
  • "location"
  • "class"
  • "stat"
  • "skill"
  • "effect"
  • "familiar"
  • "slot"
  • "monster"
  • "element"
  • "coinmaster"
  • "phylum"
  • "thrall"
  • "bounty"
  • "servant"
  • "vykea"
  • "path"

Miscellaneous

  • "record"
  • "typedef"

More Information

The file Parser.java contains the most up-to-date version of this list.