-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathELICodeInsight.h
62 lines (51 loc) · 1.88 KB
/
ELICodeInsight.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*!
Copyright 2019-2020 Maxim Noltmeer ([email protected])
This file is part of ELI IDE.
ELI IDE is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
ELI IDE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with ELI IDE. If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
#ifndef ELICodeInsightH
#define ELICodeInsightH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.ComCtrls.hpp>
#include <vector>
#define ESH_LIGHT_THEME 1
#define ESH_DARK_THEME 0
struct Lexeme
{
String Type; //òèï ëåêñåìè (directive, function, method etc)
String Signature; //ñèãíàòóðà ëåêñåìè, òèïó _foo(num $x, sym $y)
String Description; //îïèñ òà äîäàòêîâà ³íôà
String InsertText; //òåêñò, ùî âñòàâëÿºòüñÿ â ðÿäîê ñêðèïòó ïðè âèáîð³ ëåêñåìè
Lexeme(String type, String sign, String descr, String intext)
{
Type = type;
Signature = sign;
Description = descr;
InsertText = intext;
}
bool Contain(String fragment)
{
return ((fragment != "") && (Signature.SubString(1, fragment.Length()).UpperCase() == fragment.UpperCase()));
}
};
void InitLexems();
std::vector<Lexeme> *GetResults(String fragment);
Lexeme *GetLexeme(const String &sign);
int AddLexeme(const String &type,
const String &sign,
const String &descr,
const String &insert_text);
#endif