From 38e80da075a465c29d132aa97dada5dc315e775e Mon Sep 17 00:00:00 2001 From: Armando Rivera Date: Fri, 2 Nov 2018 20:54:15 -0400 Subject: [PATCH] misc cleanup --- Keywords.txt | 13 +++++++++++++ Prototypes.txt | 4 +++- header.inc | 3 ++- runtime.inc | 4 +++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Keywords.txt b/Keywords.txt index cd08620..8172163 100644 --- a/Keywords.txt +++ b/Keywords.txt @@ -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 diff --git a/Prototypes.txt b/Prototypes.txt index 7e13fe5..e88cba4 100644 --- a/Prototypes.txt +++ b/Prototypes.txt @@ -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) diff --git a/header.inc b/header.inc index 788a5e2..1f18d94 100644 --- a/header.inc +++ b/header.inc @@ -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 diff --git a/runtime.inc b/runtime.inc index ef01591..208208e 100644 --- a/runtime.inc +++ b/runtime.inc @@ -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