@@ -156,9 +156,9 @@ function reporter(context) {
156156 } ;
157157
158158 // ignorePatternにマッチしたらmatchFnを呼ばないようにする(エラーを無視する)
159- const ignoreWhenMatched = ( ignorePattern , matchFn ) => {
159+ const ignoreWhenMatched = ( ignorePatterns , matchFn ) => {
160160 return ( text , pattern , match ) => {
161- if ( ignorePattern . test ( text ) ) {
161+ if ( ignorePatterns . some ( p => p . test ( text ) ) ) {
162162 return null ;
163163 } else {
164164 return matchFn ( text , pattern , match ) ;
@@ -172,9 +172,19 @@ function reporter(context) {
172172 matchToReplace (
173173 text ,
174174 / ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) [ 兆 億 万 ] / g,
175- ignoreWhenMatched ( / ( 数 | 何 ) ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) [ 兆 億 万 ] / g, toNumber )
175+ ignoreWhenMatched ( [ / ( 数 | 何 ) ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) [ 兆 億 万 ] / g] , toNumber )
176+ ) ;
177+ matchToReplace (
178+ text ,
179+ / ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) つ / g,
180+ ignoreWhenMatched (
181+ [
182+ / [ 一 二 三 四 五 六 七 八 九 ] つ ( 返 事 | 子 | ひ と つ | 星 | 編 | 葉 | 橋 | と [ 無 な ] い | に 一 つ ) / g,
183+ / ( た だ | 唯 | [ 女 男 ] 手 | 穴 | 瓜 | 馬 鹿 の ) [ 一 二 ] つ / g
184+ ] ,
185+ toNumber
186+ )
176187 ) ;
177- matchToReplace ( text , / ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) つ / g, toNumber ) ;
178188 matchToReplace ( text , / ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) 回 / g, toNumber ) ;
179189 matchToReplace ( text , / ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) か 月 / g, toNumber ) ;
180190 matchToReplace ( text , / ( [ 一 二 三 四 五 六 七 八 九 十 壱 弐 参 拾 百 〇 ] + ) 番 目 / g, toNumber ) ;
0 commit comments