Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Annlix
ShellCheck
提交
45b98f40
S
ShellCheck
项目概览
Annlix
/
ShellCheck
与 Fork 源项目一致
Fork自
镜像 / koalaman / ShellCheck
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
ShellCheck
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
45b98f40
编写于
11月 05, 2012
作者:
V
Vidar Holen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Ditched the stunted concept and added better warnings
上级
a25cc75a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
3 deletion
+30
-3
Shpell/Parser.hs
Shpell/Parser.hs
+30
-3
未找到文件。
Shpell/Parser.hs
浏览文件 @
45b98f40
...
@@ -789,7 +789,12 @@ readBraceGroup = do
...
@@ -789,7 +789,12 @@ readBraceGroup = do
prop_readWhileClause
=
isOk
readWhileClause
"while [[ -e foo ]]; do sleep 1; done"
prop_readWhileClause
=
isOk
readWhileClause
"while [[ -e foo ]]; do sleep 1; done"
readWhileClause
=
do
readWhileClause
=
do
(
T_While
id
)
<-
g_While
(
T_While
id
)
<-
g_While
pos
<-
getPosition
condition
<-
readTerm
condition
<-
readTerm
return
()
`
attempting
`
(
do
eof
parseProblemAt
pos
ErrorC
"Condition missing 'do'. Did you forget it or the ; or
\\
n before i?"
)
statements
<-
readDoGroup
statements
<-
readDoGroup
return
$
T_WhileExpression
id
condition
statements
return
$
T_WhileExpression
id
condition
statements
...
@@ -807,14 +812,32 @@ readDoGroup = do
...
@@ -807,14 +812,32 @@ readDoGroup = do
(
eof
>>
return
[]
)
<|>
(
eof
>>
return
[]
)
<|>
do
do
commands
<-
readCompoundList
commands
<-
readCompoundList
disregard
g_Done
<|>
eof
-- stunted support
disregard
g_Done
<|>
(
do
eof
case
hasFinal
"done"
commands
of
Nothing
->
parseProblemAt
pos
ErrorC
"Couldn't find a 'done' for this 'do'"
Just
(
id
)
->
addNoteFor
id
$
Note
ErrorC
"Put a ; or
\\
n before the done"
)
return
commands
return
commands
<|>
do
<|>
do
parseProblemAt
pos
ErrorC
"Can't find the 'done' for this 'do'"
parseProblemAt
pos
ErrorC
"Can't find the 'done' for this 'do'"
fail
"No done"
fail
"No done"
hasFinal
s
[]
=
Nothing
hasFinal
s
f
=
case
last
f
of
T_Pipeline
_
m
@
(
_
:
_
)
->
case
last
m
of
T_Redirecting
_
[]
(
T_SimpleCommand
_
_
m
@
(
_
:
_
))
->
case
last
m
of
T_NormalWord
_
[
T_Literal
id
str
]
->
if
str
==
s
then
Just
id
else
Nothing
_
->
Nothing
_
->
Nothing
_
->
Nothing
prop_readForClause
=
isOk
readForClause
"for f in *; do rm
\"
$f
\"
; done"
prop_readForClause
=
isOk
readForClause
"for f in *; do rm
\"
$f
\"
; done"
prop_readForClause2
=
isOk
readForClause
"for f in *; do ..."
prop_readForClause3
=
isOk
readForClause
"for f; do foo; done"
prop_readForClause3
=
isOk
readForClause
"for f; do foo; done"
readForClause
=
do
readForClause
=
do
(
T_For
id
)
<-
g_For
(
T_For
id
)
<-
g_For
...
@@ -822,7 +845,11 @@ readForClause = do
...
@@ -822,7 +845,11 @@ readForClause = do
name
<-
readVariableName
name
<-
readVariableName
spacing
spacing
values
<-
readInClause
<|>
(
readSequentialSep
>>
return
[]
)
values
<-
readInClause
<|>
(
readSequentialSep
>>
return
[]
)
group
<-
readDoGroup
<|>
(
allspacing
>>
eof
>>
return
[]
)
-- stunted support
group
<-
readDoGroup
<|>
(
allspacing
>>
eof
>>
parseProblem
ErrorC
"Missing 'do'"
>>
return
[]
)
return
$
T_ForIn
id
name
values
group
return
$
T_ForIn
id
name
values
group
readInClause
=
do
readInClause
=
do
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录