misc cleanup

This commit is contained in:
Armando Rivera 2018-11-02 20:54:15 -04:00
parent 8f695e0479
commit 38e80da075
4 changed files with 21 additions and 3 deletions

View File

@ -1,5 +1,6 @@
ADDR
AND
ARRAY
AS
BEGIN
BOOL
@ -10,10 +11,12 @@ CASE_ELSE
CHAR
CLASS
CLASS
CLS
CONSTANT
CONSTRUCTOR
DECLARE
DECR
DEF
DIM
DO
ELSE
@ -34,12 +37,15 @@ FALSE
FOR
FORMAT$
FUNCTION
GRAB$
IF
INCR
INSTR
INT
INTEGER
LCASE$
LEFT$
LEN(
LOADFILE$
LPCHAR
LTRIM$
@ -48,10 +54,15 @@ MAP
MCASE$
MID$
NEXT
NL
NOT
OR
PRINT
PRINTNL
PTR
REGEX
REGMATCH
REGQUERY
REPLACE$
RETURN
REVERSE$
@ -64,6 +75,8 @@ SPLIT
SPLITPATH$
STEP
STR$
STR$
STRARRAY
SUB
THEN
TO

View File

@ -1,5 +1,6 @@
ENC$ (CSTRING A, INT L, INT R)
FORMAT$ (CONSTANT CSTRING &fmt, ...)
FORMAT$ (CONSTANT CSTRING fmt, ...)
GRAB$(CONSTANT CSTRING &src, CONSTANT CSTRING &start, CONSTANT CSTRING &stop)
INSTR (CSTRING s,CSTRING match, size_t offset)
LCASE$ (CSTRING str)
LEFT$ (CSTRING s, INT length)
@ -8,6 +9,7 @@ LTRIM$ (CSTRING s)
MCASE$ (CSTRING S)
MID$ (CSTRING s, INT start, INT length)
PRINT (CSTRING A="")
REGEX (CSTRING src, CSTRING query)
REPLACE$ (CSTRING subject, CONSTANT CSTRING& search, CONSTANT CSTRING& replace)
REVERSE$ (CSTRING src)
RIGHT$ (CSTRING s, INT length)

View File

@ -67,7 +67,8 @@
#define WEND }
#define RETURN return
#define CONSTANT const
#define STR$( x ) dynamic_cast< std::ostringstream & >( ( std::ostringstream() << std::dec << x ) ).str()
// #define STR$( x ) dynamic_cast< std::ostringstream & >( ( std::ostringstream() << std::dec << x ) ).str()
#define STR$(x) std::to_string(x)
#define BOOL bool
#define INT int
#define INTEGER int

View File

@ -24,8 +24,10 @@ FUNCTION CSTRING REGEX (CSTRING src, CSTRING query) {
CSTRING result;
REGMATCH match;
REGQUERY term(query);
if (regex_search(src, match, term) == true)
if (regex_search(src, match, term,std::regex_constants::match_any) == true){
std::cout << match.size() << std::endl;
result = match[1];
}
return result;
ENDFUNCTION