Verbatim-safe typography, ^-punctuation quoting, full-range ^UUUU^, polyglot html
Typographic transforms (---, quote pairs, ~) no longer touch verbatim text: @c/@code/@source_listing content and ^'...'^ spans show exactly the characters written. "^" before any punctuation character quotes it in every target (the apostrophe excepted: ^' opens a literal span), with the new :resolve option on @@@target declaring per-target renderings. The ^UUUU^ code-point form accepts 4-6 hex digits, the full Unicode range. The html output and transform spellings are polyglot (XML-valid), in preparation for an EPUB target. New suites: transform_test, character_test (engine), typography_test (SKS). (from dev 07ce5ea86a0a)
This commit is contained in:
@@ -48,7 +48,7 @@ std::string Argtype_registry::replace_symbols(const std::string& pattern, const
|
||||
ss << "Argtype symbol " << symbol << " not defined.\n\n"
|
||||
<< "Defined argtypes:\n";
|
||||
ss << describe();
|
||||
throw Definition_error(ss.str(), loc, false);
|
||||
throw Definition_error(ss.str(), loc);
|
||||
}
|
||||
}
|
||||
return expanded;
|
||||
@@ -88,7 +88,7 @@ void Argtype_registry::add(const std::string& name, const std::string& desc,
|
||||
if (pattern != expanded_pattern) {
|
||||
ss << "expanded to:\n " << expanded_pattern << "\n";
|
||||
}
|
||||
throw Definition_error(ss.str(), loc, false);
|
||||
throw Definition_error(ss.str(), loc);
|
||||
}
|
||||
if (!default_value.empty() &&
|
||||
!std::regex_match(default_value, m_types[name].m_regex)) {
|
||||
@@ -96,7 +96,7 @@ void Argtype_registry::add(const std::string& name, const std::string& desc,
|
||||
ss << "The default value \"" << default_value << "\" for argument type \""
|
||||
<< name << "\" does not match its own pattern:\n"
|
||||
<< " " << pattern << "\n";
|
||||
throw Definition_error(ss.str(), loc, false);
|
||||
throw Definition_error(ss.str(), loc);
|
||||
}
|
||||
if (!alone_value.empty()) {
|
||||
// A pattern that matches running text cannot delimit a bare option
|
||||
@@ -110,21 +110,21 @@ void Argtype_registry::add(const std::string& name, const std::string& desc,
|
||||
// which is equally unable to delimit.
|
||||
if (std::regex_match(std::string("one two"), m_types[name].m_regex)) {
|
||||
std::stringstream ss {};
|
||||
ss << "The argument type \"" << name << "\" cannot declare an :alone value "
|
||||
<< "because its pattern matches running text:\n"
|
||||
ss << "The argument type \"" << name << "\" cannot declare an :alone value"
|
||||
<< "because its pattern matches running text:"
|
||||
<< " " << pattern << "\n\n"
|
||||
<< "An :alone value is used when an option name is written without a "
|
||||
<< "value. A type that matches running text cannot tell a bare option "
|
||||
<< "name from one whose value follows it, so the text after the name "
|
||||
<< "would be taken as the value instead.\n";
|
||||
throw Definition_error(ss.str(), loc, false);
|
||||
<< "An :alone value is used when an option name is written without a"
|
||||
<< "value. A type that matches running text cannot tell a bare option"
|
||||
<< "name from one whose value follows it, so the text after the name"
|
||||
<< "would be taken as the value instead.";
|
||||
throw Definition_error(ss.str(), loc);
|
||||
}
|
||||
if (!std::regex_match(alone_value, m_types[name].m_regex)) {
|
||||
std::stringstream ss {};
|
||||
ss << "The alone value \"" << alone_value << "\" for argument type \""
|
||||
<< name << "\" does not match its own pattern:\n"
|
||||
<< " " << pattern << "\n";
|
||||
throw Definition_error(ss.str(), loc, false);
|
||||
throw Definition_error(ss.str(), loc);
|
||||
}
|
||||
}
|
||||
m_names.push_back(name);
|
||||
|
||||
Reference in New Issue
Block a user