@@ -734,15 +734,15 @@ moduleSpfn:
734734 { if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(),rhs parseState 2))
735735 let isRec, path, xml, vis = $3
736736 if isRec then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsInvalidUseOfRec())
737- ifList.length path <> 1 then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleAbbreviationMustBeSimpleName())
738- ifList.length $1 <> 0 then raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsIgnoreAttributesOnModuleAbbreviation())
737+ ifnot (isSingleton path) then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleAbbreviationMustBeSimpleName())
738+ ifnot (isNil $1) then raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsIgnoreAttributesOnModuleAbbreviation())
739739 match vis with
740740 | Some vis -> raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsIgnoreVisibilityOnModuleAbbreviationAlwaysPrivate(vis.ToString()))
741741 | _ -> SynModuleSigDecl.ModuleAbbrev(List.head path,$5,rhs2 parseState 3 5) }
742742
743743 | opt_attributes opt_declVisibility moduleIntro colonOrEquals moduleSpecBlock
744744 { let isRec, path, xml, vis = $3
745- ifList.length path <> 1 then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleDefnMustBeSimpleName())
745+ ifnot (isSingleton path) then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleDefnMustBeSimpleName())
746746 if isRec then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsInvalidUseOfRec())
747747 let info = ComponentInfo($1,[],[],path,xml,false,vis,rhs parseState 3)
748748 if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(),rhs parseState 2))
@@ -1238,14 +1238,14 @@ moduleDefn:
12381238 | Choice1Of2 eqn ->
12391239 if Option.isSome $2 then errorR(Error(FSComp.SR.parsVisibilityDeclarationsShouldComePriorToIdentifier(),rhs parseState 2))
12401240 if isRec then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsInvalidUseOfRec())
1241- ifList.length path <> 1 then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleAbbreviationMustBeSimpleName())
1242- ifList.length $1 <> 0 then raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsIgnoreAttributesOnModuleAbbreviation())
1241+ ifnot (isSingleton path) then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleAbbreviationMustBeSimpleName())
1242+ ifnot (isNil $1) then raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsIgnoreAttributesOnModuleAbbreviation())
12431243 match vis with
12441244 | Some vis -> raiseParseErrorAt (rhs parseState 1) (FSComp.SR.parsIgnoreAttributesOnModuleAbbreviationAlwaysPrivate(vis.ToString()))
12451245 | _ -> ()
12461246 [ SynModuleDecl.ModuleAbbrev(List.head path,eqn,(rhs parseState 3, eqn) ||> unionRangeWithListBy (fun id -> id.idRange) ) ]
12471247 | Choice2Of2 def ->
1248- ifList.length path <> 1 then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleAbbreviationMustBeSimpleName())
1248+ ifnot (isSingleton path) then raiseParseErrorAt (rhs parseState 3) (FSComp.SR.parsModuleAbbreviationMustBeSimpleName())
12491249 let info = ComponentInfo(attribs,[],[],path,xml,false,vis,rhs parseState 3)
12501250 [ SynModuleDecl.NestedModule(info, isRec, def, false,(rhs2 parseState 3 4, def) ||> unionRangeWithListBy (fun d -> d.Range) ) ] }
12511251
@@ -1706,7 +1706,10 @@ memberCore:
17061706 let memFlags = memFlagsBuilder memberKind
17071707
17081708 let valSynInfo =
1709- let adjustValueArg valueArg = if List.length valueArg = 1 then valueArg else SynInfo.unnamedTopArg
1709+ let adjustValueArg valueArg =
1710+ match valueArg with
1711+ | [_] -> valueArg
1712+ | _ -> SynInfo.unnamedTopArg
17101713
17111714 match memberKind, valSynInfo, memFlags.IsInstance with
17121715 | MemberKind.PropertyGet,SynValInfo ([],_ret), false
@@ -2375,9 +2378,9 @@ defnBindings:
23752378 BindingSetPreAttrs(mLetKwd,isRec,isUse,
23762379 (fun attrs vis ->
23772380 // apply the builder
2378- let binds = localBindingsBuilder attrs vis mLetKwd
2379- if not isRec &&List.length binds > 1 then
2380- reportParseErrorAt mLetKwd (FSComp.SR.parsLetAndForNonRecBindings())
2381+ let binds = localBindingsBuilder attrs vis mLetKwd
2382+ if not isRec &¬ (isNilOrSingleton binds) then
2383+ reportParseErrorAt mLetKwd (FSComp.SR.parsLetAndForNonRecBindings())
23812384 [],binds),
23822385 bindingSetRange) }
23832386
@@ -2414,10 +2417,10 @@ hardwhiteLetBindings:
24142417
24152418 // the first binding swallow any attributes prior to the 'let'
24162419 BindingSetPreAttrs(mLetKwd,isRec,isUse,
2417- (fun attrs vis ->
2418- let binds = localBindingsBuilder attrs vis mLetKwd
2419- if not isRec &&List.length binds > 1 then
2420- reportParseErrorAt mLetKwd (FSComp.SR.parsLetAndForNonRecBindings())
2420+ (fun attrs vis ->
2421+ let binds = localBindingsBuilder attrs vis mLetKwd
2422+ if not isRec &¬ (isNilOrSingleton binds) then
2423+ reportParseErrorAt mLetKwd (FSComp.SR.parsLetAndForNonRecBindings())
24212424 [],binds),
24222425 bindingSetRange), (unionRanges mLetKwd bindingSetRange) }
24232426
@@ -2823,7 +2826,7 @@ atomicPattern:
28232826 { SynPat.OptionalVal($2,lhs parseState) }
28242827 | atomicPatternLongIdent %prec prec_atompat_pathop
28252828 { let vis,lidwd = $1
2826- ifList.length lidwd.Lid > 1 || (let c = (List.head lidwd.Lid).idText.[0] in Char.IsUpper(c) && not (Char.IsLower c))
2829+ ifnot (isNilOrSingleton lidwd.Lid) || (let c = (List.head lidwd.Lid).idText.[0] in Char.IsUpper(c) && not (Char.IsLower c))
28272830 then mkSynPatMaybeVar lidwd vis (lhs parseState)
28282831 else mkSynPatVar vis (List.head lidwd.Lid) }
28292832 | constant