autocorrect 1.10.7

A linter and formatter for help you improve copywriting, to correct spaces, words, punctuations between CJK (Chinese, Japanese, Korean).
Documentation
newline = @{ "\n" | "\r" }
space = @{ " "+ }

other = ${ !(string) ~ ANY }
comment = ${ single_line_comment | multiline_comment }
refrence = ${ "#:" ~ (!(newline) ~ ANY)*  }
single_line_comment = _{ "#" ~ (!(newline) ~ ANY)* }
multiline_comment = _{ "/*" ~ (!("*/") ~ ANY)* ~ "*/"}

key_func = @{ ("msgid" | "msgid_plural" | "msgctxt") }
value_func = @{ "msgstr" }

key = ${ key_func ~ other* ~ space* ~ str_val } 
value = ${ value_func ~ other* ~ space* ~ string }
pair = ${ key ~ newline+ ~ value } 

string = @{ str_val }
str_val = @{
  ("'" ~ (!(newline | "'") ~ ANY)* ~ "'") 
  | ("\"" ~ (!(newline | "\"") ~ ANY)* ~ "\"") 
}

line = _{ pair | key | value | string | refrence | comment | space | newline | other }
item = _{ SOI ~ line* ~ EOI }