Skip to content

Instantly share code, notes, and snippets.

@Amakata
Created January 2, 2017 08:43
Show Gist options
  • Save Amakata/649ff9028fe63068ae99e3e7f3b43207 to your computer and use it in GitHub Desktop.
Save Amakata/649ff9028fe63068ae99e3e7f3b43207 to your computer and use it in GitHub Desktop.
kpeg ダブルクオートで囲った文字列
```
# ダブルクオートで囲った文字列
# バックスラッシュ記法できる文字
# 「\"」 ダブルクオート
# 「\n」 改行
# 「\r」 キャリッジリターン
# 「\t」 タブ
# 「\v」 垂直タブ
# 「\f」 改ページ
# 「\b」 バックスペース
# 「\a」 ベル
# 「\e」 エスケープ
# 「\s」 スペース
# 「\改行」 文字列に改行を含めずに改行する
DoubleQuoteString = '"' DoubleQuoteStringElement+:cc '"' { cc.join }
DoubleQuoteStringElement = ( DoubleQuoteStringDoubleQuote
| DoubleQuoteStringR
| DoubleQuoteStringCR
| DoubleQuoteStringTab
| DoubleQuoteStringVTab
| DoubleQuoteStringNewpage
| DoubleQuoteStringBackspace
| DoubleQuoteStringBell
| DoubleQuoteStringEscape
| DoubleQuoteStringSpace
| DoubleQuoteStringEmpty
| DoubleQuoteStringOtherchar
)
DoubleQuoteStringDoubleQuote = '\"' { '"' }
DoubleQuoteStringR = '\n' { "\n" }
DoubleQuoteStringCR = '\r' { "\r" }
DoubleQuoteStringTab = '\t' { "\t" }
DoubleQuoteStringVTab = '\v' { "\v" }
DoubleQuoteStringNewpage = '\f' { "\f" }
DoubleQuoteStringBackspace = '\b' { "\b" }
DoubleQuoteStringBell = '\a' { "\a" }
DoubleQuoteStringEscape = '\e' { "\e" }
DoubleQuoteStringSpace = '\s' { "\s" }
DoubleQuoteStringEmpty = "\\\n" { '' }
DoubleQuoteStringOtherchar = < /[^"]/ > { text }
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment