lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


# Lua mode for fte

# Don't forget to put in an include for it in main.fte
# and recompile your configuration - then restart FTE


colorize LUA {
    SyntaxParser       = 'SIMPLE';

    color {
        { 'Normal',      'Lang_Default' },
        { 'Number',      'Lang_DecimalNumber' },
        { 'HexNumber',   'Lang_HexNumber' },
        { 'Punctuation', 'Lang_Punctuation' },
        { 'String',      'Lang_String' },
        { 'Comment',     'Lang_Comment' },
    };

    keyword 'Editor_Keywords' {
        "and", "break", "do", "else",
        "elseif", "end", "for", "function",
        "if", "local", "nil", "not",
        "or", "repeat", "return", "then",
        "until", "while",
    };

    h_state 0 { 'Normal' }
    h_trans { 4, '-s', 'a-zA-Z_', 'Normal' }
    h_trans { 1, '<', '--', 'Comment' }
    h_trans { 2, '<', '"', 'String' }
    h_trans { 3, '<', '\'', 'String' }
    h_trans { 5, '<s', '0-9', 'Number' }
    h_trans { 0, 'S', '_a-zA-Z0-9', 'Punctuation' }

    h_state 1 { 'Comment' }
    h_trans { 0, '$', '', 'Comment' }

    h_state 2 { 'String' }
    h_trans { 0, '>', '"', 'String' }
    h_trans { 0, '$', '', 'String' }

    h_state 3 { 'String' }
    h_trans { 0, '>', '\'', 'String' }
    h_trans { 0, '$', '', 'String' }

    h_state 4 { 'Normal' }
    h_trans { 0, '$', '', 'Normal' }
    h_wtype { 0, 0, 0, 'i', 'a-zA-Z0-9_' }


    h_state 5 { 'Number' }
    h_trans { 0, '-S', '0-9', 'Normal' }
    h_trans { 0, '$', '', 'Normal' }

}

mode LUA: PLAIN {      # LUA Mode
    FileNameRx          = /\.\cLUA$/;
    HilitOn             = 1;
    Colorizer           = 'LUA';
    AutoIndent          = 1;
    IndentMode          = 'PLAIN';
    TabSize             = 8;
    SpaceTabs           = 1;
    MatchCase           = 1;
    Trim                = 1;
    MultiLineHilit      = 1;
    AutoHilitParen      = 1;

    SaveFolds           = 2;      # save fold info at end of line
    CommentStart        = ' --';
    CommentEnd          = '';

    RoutineRegexp       = '^{procedure}|{function}';
}