88 create読点Matcher ,
99 concatJoishiTokens ,
1010 createKeyFromKey ,
11- restoreToSurfaceFromKey
11+ restoreToSurfaceFromKey , is括弧Token
1212} from "./token-utils" ;
1313import { TxtNode } from "@textlint/ast-node-types" ;
1414import { TextlintRuleModule } from "@textlint/types" ;
@@ -113,7 +113,7 @@ export interface Options {
113113
114114 TODO: need abstraction
115115 */
116- const report : TextlintRuleModule < Options > = function ( context , options = { } ) {
116+ const report : TextlintRuleModule < Options > = function ( context , options = { } ) {
117117 const helper = new RuleHelper ( context ) ;
118118 // 最低間隔値
119119 const minInterval = options . min_interval !== undefined ? options . min_interval : defaultOptions . min_interval ;
@@ -124,7 +124,7 @@ const report: TextlintRuleModule<Options> = function(context, options = {}) {
124124 const allow = options . allow || defaultOptions . allow ;
125125 const separatorCharacters = options . separatorCharacters || defaultOptions . separatorCharacters ;
126126 const commaCharacters = options . commaCharacters || defaultOptions . commaCharacters ;
127- const { Syntax, report, RuleError } = context ;
127+ const { Syntax, report, RuleError} = context ;
128128 const is読点Token = create読点Matcher ( commaCharacters ) ;
129129 return {
130130 [ Syntax . Paragraph ] ( node ) {
@@ -154,10 +154,19 @@ const report: TextlintRuleModule<Options> = function(context, options = {}) {
154154 if ( isStrict ) {
155155 return is助詞Token ( token ) ;
156156 }
157- // デフォルトでは、"、"を間隔値の距離としてカウントする
157+ // "("や")"などもトークンとしてカウントする
158+ // xxxx(xxx) xxx でカッコの中と外に距離を一つ増やす目的
159+ // https://github.com/textlint-ja/textlint-rule-no-doubled-joshi/issues/31
160+ if ( is括弧Token ( token ) ) {
161+ return true ;
162+ }
158163 // "、" があると助詞同士の距離が開くようにすることで、並列的な"、"の使い方を許容する目的
159164 // https://github.com/azu/textlint-rule-no-doubled-joshi/issues/2
160- return is助詞Token ( token ) || is読点Token ( token ) ;
165+ if ( is読点Token ( token ) ) {
166+ return true ;
167+ }
168+ // デフォルトでは、"、"を間隔値の距離としてカウントする
169+ return is助詞Token ( token ) ;
161170 } ) ;
162171 const joshiTokenSurfaceKeyMap = createSurfaceKeyMap ( countableTokens ) ;
163172 /*
0 commit comments