diff --git a/lib/rpl/parser.rb b/lib/rpl/parser.rb index b803add..5c38919 100644 --- a/lib/rpl/parser.rb +++ b/lib/rpl/parser.rb @@ -7,7 +7,7 @@ class Parser unless input.index("\n").nil? input = input.split("\n") .map do |line| - comment_begin_index = line.index('#') + comment_begin_index = line.index('@') case comment_begin_index when nil diff --git a/spec/parser_spec.rb b/spec/parser_spec.rb index 12d3009..ccbbe93 100644 --- a/spec/parser_spec.rb +++ b/spec/parser_spec.rb @@ -311,11 +311,11 @@ dup * » end def test_with_comments - result = Parser.parse( "« 2 #deux -# on duplique le deux + result = Parser.parse( "« 2 @deux +@ on duplique le deux dup * » -# on va STOcker ce programme dans la variable 'carré' +@ on va STOcker ce programme dans la variable 'carré' 'carré' sto" ) assert_equal 3, result.size assert_equal RplProgram, result.first.class