'# A file is a class!' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace '# Inheritance' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'extends' Keyword ' ' Text.Whitespace 'BaseClass' Name '\n' Text.Whitespace '\n' Text.Whitespace '# (optional) class definition with a custom icon' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'class_name' Keyword ' ' Text.Whitespace 'MyClass' Name ',' Punctuation ' ' Text.Whitespace '"' Literal.String.Double 'res://path/to/optional/icon.svg' Literal.String.Double '"' Literal.String.Double '\n' Text.Whitespace '\n' Text.Whitespace '\n' Text.Whitespace '# Member variables' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'a' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '5' Literal.Number.Integer '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 's' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '"' Literal.String.Double 'Hello' Literal.String.Double '"' Literal.String.Double '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'arr' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '[' Punctuation '1' Literal.Number.Integer ',' Punctuation ' ' Text.Whitespace '2' Literal.Number.Integer ',' Punctuation ' ' Text.Whitespace '3' Literal.Number.Integer ']' Punctuation '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'dict' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '{' Punctuation '"' Literal.String.Double 'key' Literal.String.Double '"' Literal.String.Double ':' Punctuation ' ' Text.Whitespace '"' Literal.String.Double 'value' Literal.String.Double '"' Literal.String.Double ',' Punctuation ' ' Text.Whitespace '2' Literal.Number.Integer ':' Punctuation ' ' Text.Whitespace '3' Literal.Number.Integer '}' Punctuation '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'typed_var' Name ':' Punctuation ' ' Text.Whitespace 'int' Name.Builtin.Type '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'inferred_type' Name ' ' Text.Whitespace ':' Punctuation '=' Operator ' ' Text.Whitespace '"' Literal.String.Double 'String' Literal.String.Double '"' Literal.String.Double '\n' Text.Whitespace '\n' Text.Whitespace '# Constants' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'const' Keyword ' ' Text.Whitespace 'ANSWER' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '42' Literal.Number.Integer '\n' Text.Whitespace 'const' Keyword ' ' Text.Whitespace 'THE_NAME' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '"' Literal.String.Double 'Charly' Literal.String.Double '"' Literal.String.Double '\n' Text.Whitespace '\n' Text.Whitespace '# Enums' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'enum' Keyword ' ' Text.Whitespace '{' Punctuation 'UNIT_NEUTRAL' Name ',' Punctuation ' ' Text.Whitespace 'UNIT_ENEMY' Name ',' Punctuation ' ' Text.Whitespace 'UNIT_ALLY' Name '}' Punctuation '\n' Text.Whitespace 'enum' Keyword ' ' Text.Whitespace 'Named' Name ' ' Text.Whitespace '{' Punctuation 'THING_1' Name ',' Punctuation ' ' Text.Whitespace 'THING_2' Name ',' Punctuation ' ' Text.Whitespace 'ANOTHER_THING' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '-' Operator '1' Literal.Number.Integer '}' Punctuation '\n' Text.Whitespace '\n' Text.Whitespace '# Built-in vector types' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'v2' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace 'Vector2' Name.Builtin.Type '(' Punctuation '1' Literal.Number.Integer ',' Punctuation ' ' Text.Whitespace '2' Literal.Number.Integer ')' Punctuation '\n' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'v3' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace 'Vector3' Name.Builtin.Type '(' Punctuation '1' Literal.Number.Integer ',' Punctuation ' ' Text.Whitespace '2' Literal.Number.Integer ',' Punctuation ' ' Text.Whitespace '3' Literal.Number.Integer ')' Punctuation '\n' Text.Whitespace '\n' Text.Whitespace '\n' Text.Whitespace '# Function' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'func' Keyword ' ' Text.Whitespace 'some_function' Name '(' Punctuation 'param1' Name ',' Punctuation ' ' Text.Whitespace 'param2' Name ')' Punctuation ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'local_var' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '5' Literal.Number.Integer '\n' Text.Whitespace '\n' Text.Whitespace ' ' Text.Whitespace 'if' Keyword ' ' Text.Whitespace 'param1' Name ' ' Text.Whitespace '<' Operator ' ' Text.Whitespace 'local_var' Name ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'print' Name.Builtin '(' Punctuation 'param1' Name ')' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'elif' Keyword ' ' Text.Whitespace 'param2' Name ' ' Text.Whitespace '>' Operator ' ' Text.Whitespace '5' Literal.Number.Integer ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'print' Name.Builtin '(' Punctuation 'param2' Name ')' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'else' Keyword ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'print' Name.Builtin '(' Punctuation '"' Literal.String.Double 'Fail!' Literal.String.Double '"' Literal.String.Double ')' Punctuation '\n' Text.Whitespace '\n' Text.Whitespace ' ' Text.Whitespace 'for' Keyword ' ' Text.Whitespace 'i' Name ' ' Text.Whitespace 'in' Operator.Word ' ' Text.Whitespace 'range' Name.Builtin '(' Punctuation '20' Literal.Number.Integer ')' Punctuation ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'print' Name.Builtin '(' Punctuation 'i' Name ')' Punctuation '\n' Text.Whitespace '\n' Text.Whitespace ' ' Text.Whitespace 'while' Keyword ' ' Text.Whitespace 'param2' Name ' ' Text.Whitespace '!=' Operator ' ' Text.Whitespace '0' Literal.Number.Integer ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'param2' Name ' ' Text.Whitespace '-=' Operator ' ' Text.Whitespace '1' Literal.Number.Integer '\n' Text.Whitespace '\n' Text.Whitespace ' ' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'local_var2' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace 'param1' Name ' ' Text.Whitespace '+' Operator ' ' Text.Whitespace '3' Literal.Number.Integer '\n' Text.Whitespace ' ' Text.Whitespace 'return' Keyword ' ' Text.Whitespace 'local_var2' Name '\n' Text.Whitespace '\n' Text.Whitespace '\n' Text.Whitespace '# Functions override functions with the same name on the base/parent class.' Comment.Single '\n' Text.Whitespace "# If you still want to call them, use '.' (like 'super' in other languages)." Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'func' Keyword ' ' Text.Whitespace 'something' Name '(' Punctuation 'p1' Name ',' Punctuation ' ' Text.Whitespace 'p2' Name ')' Punctuation ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace '.' Operator 'something' Name '(' Punctuation 'p1' Name ',' Punctuation ' ' Text.Whitespace 'p2' Name ')' Punctuation '\n' Text.Whitespace '\n' Text.Whitespace '\n' Text.Whitespace '# Inner class' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'class' Keyword ' ' Text.Whitespace 'Something' Name ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'a' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace '10' Literal.Number.Integer '\n' Text.Whitespace '\n' Text.Whitespace '\n' Text.Whitespace '# Constructor' Comment.Single '\n' Text.Whitespace '\n' Text.Whitespace 'func' Keyword ' ' Text.Whitespace '_init' Name '(' Punctuation ')' Punctuation ':' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'print' Name.Builtin '(' Punctuation '"' Literal.String.Double 'Constructed!' Literal.String.Double '"' Literal.String.Double ')' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'var' Keyword ' ' Text.Whitespace 'lv' Name ' ' Text.Whitespace '=' Operator ' ' Text.Whitespace 'Something' Name '.' Operator 'new' Name '(' Punctuation ')' Punctuation '\n' Text.Whitespace ' ' Text.Whitespace 'print' Name.Builtin '(' Punctuation 'lv' Name '.' Operator 'a' Name ')' Punctuation '\n' Text.Whitespace