* status: The return status to use.
* buffer: (A pointer) The buffer to seek through.
* range: (A pointer) The range within that buffer to seek through.
+ * width_max: The width_max variable to use fo calculating width_max.
* condition: Set to TRUE to seek until whitespace is found and FALSE to seek until non-whitespace.
*/
#ifndef _di_f_macro_iki_seek_whitespace_
}
#endif // _di_f_macro_iki_seek_whitespace_
+/**
+ * Seek until a word, dash, or plus is found or not found.
+ *
+ * This will ignore the delimit placeholder.
+ *
+ * status: The return status to use.
+ * buffer: (A pointer) The buffer to seek through.
+ * range: (A pointer) The range within that buffer to seek through.
+ * width_max: The width_max variable to use fo calculating width_max.
+ * condition: Set to TRUE to seek until a word character, dash character, or plus character is found and FALSE to seek until the opposite is found.
+ */
+#ifndef _di_f_macro_iki_seek_word_dash_plus_
+ #define f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, condition) \
+ while (range->start <= range->stop && range->start < buffer->used) { \
+ if (buffer->string[range->start] == f_iki_syntax_placeholder) { \
+ range->start++; \
+ continue; \
+ } \
+ f_macro_iki_determine_width_max(buffer, range, width_max); \
+ status = f_utf_is_word_dash_plus(buffer->string + range->start, width_max); \
+ if (status == condition) break; \
+ else if (F_status_is_error(status)) break; \
+ status = f_utf_buffer_increment(*buffer, range, 1); \
+ if (F_status_is_error(status)) break; \
+ }
+#endif // _di_f_macro_iki_seek_word_dash_plus_
+
#ifdef __cplusplus
} // extern "C"
#endif
}
// skip past all initial non-word, non-dash, and non-plus.
- while (range->start <= range->stop && range->start < buffer->used) {
- if (buffer->string[range->start] == f_iki_syntax_placeholder) {
- range->start++;
- continue;
- }
-
- f_macro_iki_determine_width_max(buffer, range, width_max);
-
- status = f_utf_is_word_dash_plus(buffer->string + range->start, width_max);
- if (F_status_is_error(status)) return status;
-
- if (status == F_true) break;
-
- f_macro_iki_seek_whitespace(status, buffer, range, width_max, F_true);
- if (F_status_is_error(status)) return status;
-
- f_macro_iki_seek_whitespace(status, buffer, range, width_max, F_false);
- if (F_status_is_error(status)) return status;
- } // while
+ f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_true);
- if (range->start > range->stop) {
+ if (F_status_is_error(status)) {
+ return status;
+ }
+ else if (range->start > range->stop) {
return F_data_not_stop;
}
else if (range->start >= buffer->used) {
break;
}
- // this is not a valid vocabulary name so seek until a whitespace to prepare for the next main loop pass.
- f_macro_iki_seek_whitespace(status, buffer, range, width_max, F_true);
+ // this is not a valid vocabulary name so seek until a non-word, non-dash, or non-plus character.
+ f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_false);
if (F_status_is_error(status)) {
f_macro_string_lengths_delete(status, delimits);
return status;
range->start++;
// skip past all initial non-word, non-dash, and non-plus.
- while (range->start <= range->stop && range->start < buffer->used) {
- if (buffer->string[range->start] == f_iki_syntax_placeholder) {
- range->start++;
- continue;
- }
-
- f_macro_iki_determine_width_max(buffer, range, width_max);
-
- status = f_utf_is_word_dash_plus(buffer->string + range->start, width_max);
- if (F_status_is_error(status)) {
- f_macro_string_lengths_delete(status, delimits);
- return status;
- }
-
- if (status == F_true) break;
-
- status = f_utf_buffer_increment(*buffer, range, 1);
- if (F_status_is_error(status)) {
- f_macro_string_lengths_delete(status, delimits);
- return status;
- }
- } // while
+ f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_true);
found_vocabulary.start = range->start;
}
}
if (find_next) {
-
- while (range->start <= range->stop && range->start < buffer->used) {
-
- f_macro_iki_seek_whitespace(status, buffer, range, width_max, F_true);
- if (F_status_is_error(status)) {
- f_macro_string_lengths_delete(status, delimits);
- return status;
- }
-
- f_macro_iki_seek_whitespace(status, buffer, range, width_max, F_false);
- if (F_status_is_error(status)) {
- f_macro_string_lengths_delete(status, delimits);
- return status;
- }
-
- if (range->start > range->stop || range->start >= buffer->used) break;
-
- f_macro_iki_determine_width_max(buffer, range, width_max);
-
- status = f_utf_is_word_dash_plus(buffer->string + range->start, width_max);
- if (F_status_is_error(status)) {
- f_macro_string_lengths_delete(status, delimits);
- return status;
- }
-
- if (status == F_true) break;
-
- status = f_utf_buffer_increment(*buffer, range, 1);
- if (F_status_is_error(status)) {
- f_macro_string_lengths_delete(status, delimits);
- return status;
- }
- } // while
+ f_macro_iki_seek_word_dash_plus(status, buffer, range, width_max, F_true);
found_vocabulary.start = range->start;
find_next = F_false;
For compatibility with the FSS terminology, the Vocabulary Name is to be considered the Object and the Vocabulary value is to be considered the Content.
- Whitespace (or start of file), must exist before any valid variable name.
+ Whitespace, non-word (and non "_", "-", "+") character punctuations, or the start of file must exist before any valid variable name.
+ Whitespace and non-word (and non "_", "-", "+") character punctuations may not exist as part of the variable name.
The IKI format will use IKI-0000 to represent an IKI with no explicitly defined vocabulary.
Whereas IKI-0001 and beyond represent a specific IKI vocabulary.
Key\:
- \s = whitespace.
- \o = any printable word character, including "_", "-", "+".
+ \o = any printable word character, including "_", "-", "+" (and Unicode equivalents).
\c = any character, including whitespace and non-printing, and any delimited quote (used as the opening quote) or a any quote (undelimited) not used as the opening quote.
\q = either a single quote (') or a double quote (").
\x = any character.
+ \W = any non-word character, discluding "_", "-", "+" (and Unicode equivalents).
* = 0 or more occurrences.
~ = one or more occurrences, or 0 if at start of file.
Structure\:
- \x*\s~\o:\q\c\q
+ \x*\W~\o:\q\c\q
Example\:
# fss-000d iki-0000