X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FParser%2FSQLite.pm;fp=lib%2FSQL%2FTranslator%2FParser%2FSQLite.pm;h=b3e81ae3a148b331aee020794a48a67540dbf39d;hb=32d2b62fb6110c4637feee083bbb6dee08513d39;hp=ddc9ea438b3cffc190c58770e4e9e69fec60d5f3;hpb=5e48784e9e449d1d79da28fc059c95006b709397;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm index ddc9ea4..b3e81ae 100644 --- a/lib/SQL/Translator/Parser/SQLite.pm +++ b/lib/SQL/Translator/Parser/SQLite.pm @@ -619,18 +619,20 @@ UNIQUE : /unique/i { 1 } SEMICOLON : ';' -NAME : /["']?(\w+)["']?/ { $return = $1 } +NAME : /\w+/ + | DQSTRING + | SQSTRING -VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ +DQSTRING : '"' /((?:[^"]|"")+)/ '"' + { ($return = $item[2]) =~ s/""/"/g } + +SQSTRING : "'" /((?:[^']|'')*)/ "'" + { ($return = $item[2]) =~ s/''/'/g } + +VALUE : /[-+]?\d*\.?\d+(?:[eE]\d+)?/ { $item[1] } - | /'.*?'/ - { - # remove leading/trailing quotes - my $val = $item[1]; - $val =~ s/^['"]|['"]$//g; - $return = $val; - } - | /NULL/ + | SQSTRING + | /NULL/i { 'NULL' } | /CURRENT_TIMESTAMP/i { 'CURRENT_TIMESTAMP' }