Sha256: 3d4ea8ac7b9c737e19df3512fb84050b7e73fbca3833f9d3e7e15b779aa39a2f

Contents?: true

Size: 643 Bytes

Versions: 50

Compression:

Stored size: 643 Bytes

Contents

#include "headers.h"

bool is_valid_identifier(const char* const restrict string, const u64 string_length) {
	u64 i;
	
	assert_comparison(string, !=, NULL);
	assert_comparison(string_length, !=, 0);
	
	if (!(
		(*string >= 'a' && *string <= 'z') ||
		(*string >= 'A' && *string <= 'Z') ||
		*string == '$' || *string == '_' || *string == '@'
	)) return false;
	
	for (i = 1; i < string_length; ++i) {
		if (!(
			(string[i] >= 'a' && string[i] <= 'z') ||
			(string[i] >= 'A' && string[i] <= 'Z') ||
			(string[i] >= '0' && string[i] <= '9') ||
			string[i] == '$' || string[i] == '_' || string[i] == '@'
		)) return false;
	}
	return true;
}

Version data entries

50 entries across 49 versions & 6 rubygems

Version Path
ufos-1.0.94 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
aliens-1.0.94 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
freespeech-1.0.94 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
elonmusk-1.0.94 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
politics-1.0.94 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
democracy-1.0.94 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
democracy-1.0.93 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
ufos-1.0.91 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
aliens-1.0.91 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
freespeech-1.0.91 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
elonmusk-1.0.91 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
politics-1.0.91 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
politics-1.0.89 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
ufos-1.0.87 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
aliens-1.0.87 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
freespeech-1.0.87 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
elonmusk-1.0.87 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
politics-1.0.87 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
ufos-1.0.88 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c
aliens-1.0.88 ./other/old_compiler/shiltium7 (2)/is_valid_identifier.c