--bcaec520f0b99b341204ac42811f
Content-Type: text/plain; charset=ISO-8859-1

Syntax error:
( @HashMapWithAllRegex.fetch( string ) ) <- missing parentheses?

On 6 September 2011 14:41, Philipp Altmann <altmann.work / googlemail.com>wrote:

> Hi guys,
>
> this is my Code:
>
>  def getRegex(string)
>    if @HashMapWithAllRegex.has_key?(string) ?
> (@HashMapWithAllRegex.fetch(string) : raise(ArgumentError, "This regex
> is not specified")
>    end
>  end
>
> Error Message:
>
> SyntaxError:
> /Users/Philipp/Documents/projects/objcdoc/src/RegexProvider.rb:19:
> syntax error, unexpected tIVAR
>
>    if @HashMapWithAllRegex.has_key?(string) ? return
> @HashMapWithAllRegex.fetch(string : raise(ArgumentError, "This regex is
> not specified")
>                                                                         ^
>  require at org/jruby/RubyKernel.java:1038
>   (root) at
> /Users/Philipp/Documents/projects/objcdoc/src/RegexProvider.rb:6
>  require at org/jruby/RubyKernel.java:1038
>   (root) at /Users/Philipp/Documents/projects/objcdoc/src/Main.rb:1
>
>
> Why will this don't work? I think in Java will this construct work :-).
>
> I hope you can explain me why this isnt't working in ruby.
>
> Greetings
>
> Philipp
>
> --
> Posted via http://www.ruby-forum.com/.
>
>

--bcaec520f0b99b341204ac42811f--