Created
December 31, 2016 13:16
-
-
Save Amakata/c89f7db9ec17215ca365f0b1c50b79ff to your computer and use it in GitHub Desktop.
kpegでシングルクオート文字列をparse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
# クオートで囲った文字列 クオートの中で「\'」を使うことで「'」表現することができる。「\\」を使うことで「\」を表現することができる。 | |
QuoteString = "'" QuoteStringElement+:cc "'" { cc.join } | |
QuoteStringElement = ( QuoteStringSingleQuote | |
| QuoteStringBackslash | |
| QuoteStringOtherchar | |
) | |
QuoteStringSingleQuote = "\\'" { "'" } | |
QuoteStringBackslash = "\\\\" { "\\" } | |
QuoteStringOtherchar = < /[^']/ > { text } | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment