diff --git a/lexers/embedded/csv.xml b/lexers/embedded/csv.xml new file mode 100644 index 000000000..b70c2f8b1 --- /dev/null +++ b/lexers/embedded/csv.xml @@ -0,0 +1,53 @@ + + + + + CSV + csv + *.csv + text/csv + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lexers/testdata/csv.actual b/lexers/testdata/csv.actual new file mode 100644 index 000000000..f4941483d --- /dev/null +++ b/lexers/testdata/csv.actual @@ -0,0 +1,2 @@ +hello,"newline: +quote: "" comma: ,",1,"",""stuff,,1.1 diff --git a/lexers/testdata/csv.expected b/lexers/testdata/csv.expected new file mode 100644 index 000000000..0a4e12fec --- /dev/null +++ b/lexers/testdata/csv.expected @@ -0,0 +1,17 @@ +[ + {"type":"LiteralString","value":"hello"}, + {"type":"Punctuation","value":","}, + {"type":"LiteralStringDouble","value":"\"newline:\nquote: "}, + {"type":"LiteralStringEscape","value":"\"\""}, + {"type":"LiteralStringDouble","value":" comma: ,\""}, + {"type":"Punctuation","value":","}, + {"type":"LiteralString","value":"1"}, + {"type":"Punctuation","value":","}, + {"type":"LiteralStringDouble","value":"\"\""}, + {"type":"Punctuation","value":","}, + {"type":"LiteralStringDouble","value":"\"\""}, + {"type":"LiteralString","value":"stuff"}, + {"type":"Punctuation","value":",,"}, + {"type":"LiteralString","value":"1.1"}, + {"type":"Punctuation","value":"\n"} +]