rpl comments with @
This commit is contained in:
parent
2a005112be
commit
3747453aef
2 changed files with 4 additions and 4 deletions
|
@ -7,7 +7,7 @@ class Parser
|
||||||
unless input.index("\n").nil?
|
unless input.index("\n").nil?
|
||||||
input = input.split("\n")
|
input = input.split("\n")
|
||||||
.map do |line|
|
.map do |line|
|
||||||
comment_begin_index = line.index('#')
|
comment_begin_index = line.index('@')
|
||||||
|
|
||||||
case comment_begin_index
|
case comment_begin_index
|
||||||
when nil
|
when nil
|
||||||
|
|
|
@ -311,11 +311,11 @@ dup * »
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_with_comments
|
def test_with_comments
|
||||||
result = Parser.parse( "« 2 #deux
|
result = Parser.parse( "« 2 @deux
|
||||||
# on duplique le deux
|
@ on duplique le deux
|
||||||
dup * »
|
dup * »
|
||||||
|
|
||||||
# on va STOcker ce programme dans la variable 'carré'
|
@ on va STOcker ce programme dans la variable 'carré'
|
||||||
'carré' sto" )
|
'carré' sto" )
|
||||||
assert_equal 3, result.size
|
assert_equal 3, result.size
|
||||||
assert_equal RplProgram, result.first.class
|
assert_equal RplProgram, result.first.class
|
||||||
|
|
Loading…
Add table
Reference in a new issue