changeset 37087 | f0b6fbea00cf |
parent 36535 | db33c5bc781f |
child 37253 | 7c0f40f4f7bf |
37086:f99d64e8a4e4 | 37087:f0b6fbea00cf |
---|---|
17 parser, |
17 parser, |
18 pycompat, |
18 pycompat, |
19 registrar, |
19 registrar, |
20 scmutil, |
20 scmutil, |
21 util, |
21 util, |
22 ) |
|
23 from .utils import ( |
|
24 stringutil, |
|
22 ) |
25 ) |
23 |
26 |
24 elements = { |
27 elements = { |
25 # token-type: binding-strength, primary, prefix, infix, suffix |
28 # token-type: binding-strength, primary, prefix, infix, suffix |
26 "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None), |
29 "(": (20, None, ("group", 1, ")"), ("func", 1, ")"), None), |
443 enc = getstring(x, _("eol requires a style name")) |
446 enc = getstring(x, _("eol requires a style name")) |
444 |
447 |
445 s = [] |
448 s = [] |
446 for f in mctx.existing(): |
449 for f in mctx.existing(): |
447 d = mctx.ctx[f].data() |
450 d = mctx.ctx[f].data() |
448 if util.binary(d): |
451 if stringutil.binary(d): |
449 continue |
452 continue |
450 if (enc == 'dos' or enc == 'win') and '\r\n' in d: |
453 if (enc == 'dos' or enc == 'win') and '\r\n' in d: |
451 s.append(f) |
454 s.append(f) |
452 elif enc == 'unix' and re.search('(?<!\r)\n', d): |
455 elif enc == 'unix' and re.search('(?<!\r)\n', d): |
453 s.append(f) |
456 s.append(f) |