123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- class_name GdScriptEdit
- extends CodeEdit
- const keywords: Array[String] = [
- # Comparison
- "<", # LESS,
- "<=", # LESS_EQUAL,
- ">", # GREATER,
- ">=", # GREATER_EQUAL,
- "==", # EQUAL_EQUAL,
- "!=", # BANG_EQUAL,
- # Logical
- "and", # AND,
- "or", # OR,
- "not", # NOT,
- "&&", # AMPERSAND_AMPERSAND,
- "||", # PIPE_PIPE,
- "!", # BANG,
- # Bitwise
- "&", # AMPERSAND,
- "|", # PIPE,
- "~", # TILDE,
- "^", # CARET,
- "<<", # LESS_LESS,
- ">>", # GREATER_GREATER,
- # Math
- "+", # PLUS,
- "-", # MINUS,
- "*", # STAR,
- "**", # STAR_STAR,
- "/", # SLASH,
- "%", # PERCENT,
- # Assignment
- "=", # EQUAL,
- "+=", # PLUS_EQUAL,
- "-=", # MINUS_EQUAL,
- "*=", # STAR_EQUAL,
- "**=", # STAR_STAR_EQUAL,
- "/=", # SLASH_EQUAL,
- "%=", # PERCENT_EQUAL,
- "<<=", # LESS_LESS_EQUAL,
- ">>=", # GREATER_GREATER_EQUAL,
- "&=", # AMPERSAND_EQUAL,
- "|=", # PIPE_EQUAL,
- "^=", # CARET_EQUAL,
- # Control flow
- "if", # IF,
- "elif", # ELIF,
- "else", # ELSE,
- "for", # FOR,
- "while", # WHILE,
- "break", # BREAK,
- "continue", # CONTINUE,
- "pass", # PASS,
- "return", # RETURN,
- "match", # MATCH,
- # Keywords
- "as", # AS,
- "assert", # ASSERT,
- "await", # AWAIT,
- "breakpoint", # BREAKPOINT,
- "class", # CLASS,
- "class_name", # CLASS_NAME,
- "const", # CONST,
- "enum", # ENUM,
- "extends", # EXTENDS,
- "func", # FUNC,
- "in", # IN,
- "is", # IS,
- "namespace", # NAMESPACE
- "preload", # PRELOAD,
- "self", # SELF,
- "signal", # SIGNAL,
- "static", # STATIC,
- "super", # SUPER,
- "trait", # TRAIT,
- "var", # VAR,
- "void", # VOID,
- "yield", # YIELD,
- # Punctuation
- "[", # BRACKET_OPEN,
- "]", # BRACKET_CLOSE,
- "{", # BRACE_OPEN,
- "}", # BRACE_CLOSE,
- "(", # PARENTHESIS_OPEN,
- ")", # PARENTHESIS_CLOSE,
- ",", # COMMA,
- ";", # SEMICOLON,
- ".", # PERIOD,
- "..", # PERIOD_PERIOD,
- ":", # COLON,
- "$", # DOLLAR,
- "->", # FORWARD_ARROW,
- ]
- func _ready() -> void:
- const keywords_color = Color(1.0, 0, 0)
- var gd_syntax_highlight = SyntaxHighlighter.new()
- var dict_keyword = {};
- for keyword in keywords:
- #dict_keyword.put(keyword, keywords_color)
- #set_syntax_highlighter(gd_syntax_highlight)
|