Skip to content

Commit

Permalink
C2CR: fixed constant translations
Browse files Browse the repository at this point in the history
  • Loading branch information
ysbaddaden committed Jun 20, 2018
1 parent 8d7d307 commit 1413583
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions samples/c2cr/constant.cr
Expand Up @@ -6,10 +6,15 @@ module C2CR
when "uint16_t" then "UInt16"
when "uint32_t" then "UInt32"
when "uint64_t" then "UInt64"
when .starts_with?("const ")
spelling[6..-1].camelcase
else
spelling.camelcase
spelling = spelling[6..-1] if spelling.starts_with?("const ")
spelling = spelling.lstrip('_') if spelling.starts_with?('_')

if spelling[0]?.try(&.ascii_uppercase?)
spelling
else
spelling.camelcase
end
end
end
end
Expand Down

0 comments on commit 1413583

Please sign in to comment.