Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd2219ba

Browse files
committed
lint fixes
character class has duplicated rangeindentation
1 parentbbb135b commitd2219ba

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

‎lib/coderay/scanners/applescript.rb‎

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
moduleCodeRay
66
moduleScanners
7-
7+
88
classAppleScript <Scanner
99

1010
register_for:applescript
11-
11+
1212
RESERVED_WORDS=[
1313
'#include','for','foreach','if','elseif','else','while','do','dowhile','end',
1414
'switch','case','return','break','continue','in','to','of','repeat','tell','then','as'
@@ -100,9 +100,9 @@ class AppleScript < Scanner
100100
'UTC','valueOf','variable','version','Video','visible','void','watch','width',
101101
'with','wordwrap','XML','xmlDecl','XMLNode','XMLSocket'
102102
]
103-
103+
104104
PREDEFINED_TYPES=[
105-
'boolean','small integer','integer','double integer',
105+
'boolean','small integer','integer','double integer',
106106
'small real','real','date','list','record','string','class'
107107
]
108108

@@ -118,21 +118,21 @@ class AppleScript < Scanner
118118
'all caps','all lowercase','bold','condensed','expanded','hidden','italic','outline','plain','shadow','small caps','strikethrough','subscript','superscript','underline',
119119
'version'
120120
]
121-
121+
122122
PLAIN_STRING_CONTENT={
123123
"'"=>/[^'\n]+/,
124124
'"'=>/[^"\n]+/,
125125
}
126-
127-
126+
127+
128128
IDENT_KIND=CaseIgnoringWordList.new(:ident).
129129
add(RESERVED_WORDS,:reserved).
130130
add(KEYWORD_OPERATOR,:operator).
131131
add(DIRECTIVES,:directive).
132132
add(PREDEFINED_TYPES,:pre_type).
133133
add(PREDEFINED_CONSTANTS,:pre_constant)
134-
135-
134+
135+
136136

137137
defscan_tokenstokens,options
138138

@@ -145,70 +145,70 @@ def scan_tokens tokens, options
145145
match=nil
146146

147147
ifstate ==:initial
148-
148+
149149
ifscan(/\s+/x)
150150
kind=:space
151-
151+
152152
elsifscan(%r!\{\$ [^}]*\}? |\(\*\$ (?: .*?\*\) | .* ) !mx)
153153
kind=:preprocessor
154-
155-
elsifscan(/^[\s\t]*--.*/x)
154+
155+
elsifscan(/^[\s]*--.*/x)
156156
kind=:comment
157157
elsifscan(/\(\* (?: .*?\*\)$ | .* )/mx)
158158
kind=:comment
159-
159+
160160
elsifscan(/ [-+*\/=<>:;,.@\^|\(\)\[\]]+ /x)
161161
kind=:operator
162-
162+
163163
elsifmatch=scan(/ [A-Za-z_][A-Za-z_0-9]* /x)
164164
kind=IDENT_KIND[match]
165-
165+
166166
elsifmatch=scan(/ ' ( [^\n']|'' ) (?:'|$) /x)
167167
tokens <<[:open,:char]
168168
tokens <<["'",:delimiter]
169169
tokens <<[self[1],:content]
170170
tokens <<["'",:delimiter]
171171
tokens <<[:close,:char]
172172
next
173-
173+
174174
elsifmatch=scan(/["']/)
175175
tokens <<[:open,:string]
176176
state=:string
177177
plain_string_content=PLAIN_STRING_CONTENT[match]
178178
kind=:delimiter
179-
179+
180180
else
181181
kind=:plain
182182
getch
183183

184184
end
185-
186-
elsifstate ==:string
187-
ifscan(plain_string_content)
188-
kind=:content
189-
elsifscan(/['"]/)
190-
tokens <<[matched,:delimiter]
191-
tokens <<[:close,:string]
192-
state=:initial
193-
next
194-
elsifscan(/\\ | $ /x)
195-
tokens <<[:close,:string]
196-
kind=:error
197-
state=:initial
198-
end
199185

200-
else
201-
raise_inspect"else case\" reached; %p not handled." %peek(1),tokens
186+
elsifstate ==:string
187+
ifscan(plain_string_content)
188+
kind=:content
189+
elsifscan(/['"]/)
190+
tokens <<[matched,:delimiter]
191+
tokens <<[:close,:string]
192+
state=:initial
193+
next
194+
elsifscan(/\\ | $ /x)
195+
tokens <<[:close,:string]
196+
kind=:error
197+
state=:initial
202198
end
203-
199+
200+
else
201+
raise_inspect"else case\" reached; %p not handled." %peek(1),tokens
202+
end
203+
204204
match ||=matched
205205
if $DEBUGand notkind
206206
raise_inspect'Error token %p in line %d' %
207207
[[match,kind],line],tokens
208208
end
209209
raise_inspect'Empty token',tokensunlessmatch
210210
tokens <<[match,kind]
211-
211+
212212
end
213213
tokens
214214
end

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp