Sha256: 1a1f1841dfd3111b84ceca67528f6488784927ec011495ecea55bb5d7169d55c

Contents?: true

Size: 1.36 KB

Versions: 46

Compression:

Stored size: 1.36 KB

Contents

/*
Shiltiumcomp -- the first Shiltolang compiler

Copyright (C) 2010 Gregory Cohen <gregorycohenvideos@gmail.com>

This program 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.

This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
*/

void get_next_char(ParserState* cr state, char utf8_char[7]) attr_nonnull;

attrs_const_and_nonnull
static inline bool get_length_of_utf8_char(const char utf8_char[7]) {
	assert_comparison(utf8_char, !=, NULL, const char*, void*);
	
	return ARRAY_INDEX(utf8_char, 6);
}

/*
 *  Tests whether utf8_char is equal to ascii_char and returns
 *  a boolean value indicating whether or not it is equal.
 */
attrs_const_and_nonnull
static inline bool chreq_utf8_ascii(const char utf8_char[7], const char ascii_char) {
	assert_comparison(utf8_char, !=, NULL, const char*, void*);
	
	return get_length_of_utf8_char(utf8_char) == 1 && DEREF(utf8_char) == ascii_char;
}

Version data entries

46 entries across 46 versions & 6 rubygems

Version Path
ufos-1.0.94 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
aliens-1.0.94 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
freespeech-1.0.94 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
elonmusk-1.0.94 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
politics-1.0.94 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
democracy-1.0.94 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
democracy-1.0.93 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
ufos-1.0.91 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
aliens-1.0.91 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
freespeech-1.0.91 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
elonmusk-1.0.91 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
politics-1.0.91 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
politics-1.0.89 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
ufos-1.0.87 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
aliens-1.0.87 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
freespeech-1.0.87 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
elonmusk-1.0.87 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
politics-1.0.87 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
ufos-1.0.88 ./other/old_compiler/shiltiumcomp76/portable/utf8.h
aliens-1.0.88 ./other/old_compiler/shiltiumcomp76/portable/utf8.h