Commits

starware  committed 3b9f134

Some debug removed

  • Participants
  • Parent commits d79009c

Comments (0)

Files changed (2)

File String/mush_string_c_regexp.c

 
 int regexp_exec( pcre * pattern, char * subject, int subject_size, int * ovector, int ovecsize ) {
 	int result;
-	//int ovector[30];
 	int i;
 	result = pcre_exec( pattern, NULL, subject, subject_size, 0, 0, ovector, ovecsize );
 	if (result < 0) {
 		printf( "Error while executing pattern: %d\n", result );
 		return result;
 	} else {
-		printf( "Match successful, C side dump:\n" );
+		/*printf( "Match successful, C side dump:\n" );
 		for (i=0; i < ovecsize; i++) {
 			printf( "match %d: %d,", i, ovector[i] );
-		}
+		}*/
 		printf( "\n" );
 		return result;
 	}

File String/string_test.sa

 	include TEST;
 
 	test_simple is
+		re ::= #MUSH_STRING_REGEXP( "a*" );
+		match ::= re.match( "bbb" );
+		#OUT + "Match : " + match + "\n";
+		match := re.match( "baa!" );
+		#OUT + "Match : " + match + "\n";
 	end;
 
 	test_alphanum is
 		re ::= #MUSH_STRING_REGEXP( "(\\w)(\\w)(\\w)(\\w)" );
 		match ::= re.match( "!Sa12%" );
-		#OUT + "Type: " + SYS::str_for_tp( SYS::tp( match[1] )) + ", size: " + match[1].size + "\n";
 		test( "alphanum match 1", match[1].str, "S" );
 		test( "alphanum match 2", match[2], "a" );
 		test( "alphanum match 3", match[3], "1" );
 		test( "alphanum match 4", match[4], "2" );
-		--#OUT + "Match: " + match + "\n";
 	end;
 
 	main is