From f13639d443c3ab54dacd4b5b0995205e9fa753ca Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Fri, 5 Sep 2014 14:23:05 +0200 Subject: [PATCH] misc: Use separatedBy: for the beauty of reading it, no big win --- callagent/parser/SIPParser.st | 8 ++++---- grammar/SIPGrammar.st | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/callagent/parser/SIPParser.st b/callagent/parser/SIPParser.st index bbc42b3..5435f7e 100644 --- a/callagent/parser/SIPParser.st +++ b/callagent/parser/SIPParser.st @@ -167,10 +167,10 @@ SIPGrammar subclass: SIPParser [ ^super challenge => [:nodes | | d | d := Dictionary new. - - (nodes at: 4) do: - [:each | d at: each second first put: each second third ]. - d at: (nodes at: 3) first put: (nodes at: 3) third. + (nodes at: 2) do: [:each | + "Skip the separator for now until we have withoutSeparators" + each isCharacter ifFalse: [ + d at: each first put: each third]]. d] ] diff --git a/grammar/SIPGrammar.st b/grammar/SIPGrammar.st index 05c0026..add34dc 100644 --- a/grammar/SIPGrammar.st +++ b/grammar/SIPGrammar.st @@ -529,7 +529,7 @@ PP.PPCompositeParser subclass: SIPGrammar [ challenge [ - ^('Digest' asParser, LWS, self digest_cln, (COMMA, self digest_cln) star) / + ^('Digest' asParser trim, (digest_cln separatedBy: COMMA)) / self other_challenge ] @@ -541,7 +541,7 @@ PP.PPCompositeParser subclass: SIPGrammar [ other_challenge [ - ^self auth_scheme, LWS, self auth_param, (COMMA, self auth_param) star + ^self auth_scheme trim, (auth_param separatedBy: COMMA) ] realm [