From 0424e152c684a85f4b0691f1e84aec203115333d Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 17 Feb 2012 07:42:23 +0000 Subject: * Merge Onigmo-5.13.1. [ruby-dev:45057] [Feature #5820] https://github.com/k-takata/Onigmo cp reg{comp,enc,error,exec,parse,syntax}.c reg{enc,int,parse}.h cp oniguruma.h cp tool/enc-unicode.rb cp -r enc/ git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- regerror.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'regerror.c') diff --git a/regerror.c b/regerror.c index 3c8b7371c2..2bf1d320d3 100644 --- a/regerror.c +++ b/regerror.c @@ -1,8 +1,9 @@ /********************************************************************** - regerror.c - Oniguruma (regular expression library) + regerror.c - Onigmo (Oniguruma-mod) (regular expression library) **********************************************************************/ /*- * Copyright (c) 2002-2007 K.Kosako + * Copyright (c) 2011 K.Takata * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -39,7 +40,7 @@ #endif extern UChar* -onig_error_code_to_format(int code) +onig_error_code_to_format(OnigPosition code) { const char *p; @@ -64,8 +65,8 @@ onig_error_code_to_format(int code) p = "undefined bytecode (bug)"; break; case ONIGERR_UNEXPECTED_BYTECODE: p = "unexpected bytecode (bug)"; break; - case ONIGERR_DEFAULT_ENCODING_IS_NOT_SETTED: - p = "default multibyte-encoding is not setted"; break; + case ONIGERR_DEFAULT_ENCODING_IS_NOT_SET: + p = "default multibyte-encoding is not set"; break; case ONIGERR_SPECIFIED_ENCODING_CANT_CONVERT_TO_WIDE_CHAR: p = "can't convert to wide-char on specified multibyte-encoding"; break; case ONIGERR_INVALID_ARGUMENT: @@ -114,6 +115,8 @@ onig_error_code_to_format(int code) p = "invalid pattern in look-behind"; break; case ONIGERR_INVALID_REPEAT_RANGE_PATTERN: p = "invalid repeat range {lower,upper}"; break; + case ONIGERR_INVALID_CONDITION_PATTERN: + p = "invalid condition pattern"; break; case ONIGERR_TOO_BIG_NUMBER: p = "too big number"; break; case ONIGERR_TOO_BIG_NUMBER_FOR_REPEAT_RANGE: @@ -140,6 +143,8 @@ onig_error_code_to_format(int code) p = "numbered backref/call is not allowed. (use name)"; break; case ONIGERR_TOO_BIG_WIDE_CHAR_VALUE: p = "too big wide-char value"; break; + case ONIGERR_TOO_SHORT_DIGITS: + p = "too short digits"; break; case ONIGERR_TOO_LONG_WIDE_CHAR_VALUE: p = "too long wide-char value"; break; case ONIGERR_INVALID_CODE_POINT_VALUE: @@ -232,7 +237,7 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end, *is_over = ((p < end) ? 1 : 0); } else { - len = (int)MIN((end - s), buf_size); + len = (int )MIN((end - s), buf_size); xmemcpy(buf, s, (size_t )len); *is_over = ((buf_size < (end - s)) ? 1 : 0); } @@ -246,11 +251,11 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end, extern int #ifdef HAVE_STDARG_PROTOTYPES -onig_error_code_to_str(UChar* s, int code, ...) +onig_error_code_to_str(UChar* s, OnigPosition code, ...) #else onig_error_code_to_str(s, code, va_alist) UChar* s; - int code; + OnigPosition code; va_dcl #endif { @@ -309,7 +314,7 @@ onig_error_code_to_str(s, code, va_alist) } va_end(vargs); - return (int)len; + return (int )len; } void @@ -325,7 +330,7 @@ onig_vsnprintf_with_pattern(UChar buf[], int bufsize, OnigEncoding enc, need = (pat_end - pat) * 4 + 4; - if (n + need < (size_t)bufsize) { + if (n + need < (size_t )bufsize) { strcat((char* )buf, ": /"); s = buf + onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, buf); -- cgit v1.2.1