mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-09 21:48:35 +02:00
--- Merging r47820 into '.':
U packages/fcl-res/src/rclex.inc U packages/fcl-res/src/rclex.l U packages/fcl-res/src/rcparser.pas U packages/fcl-res/src/rcparser.y --- Recording mergeinfo for merge of r47820 into '.': U . # revisions: 47820 r47820 | marco | 2020-12-19 22:47:25 +0100 (Sat, 19 Dec 2020) | 6 lines Changed paths: M /trunk/packages/fcl-res/src/rclex.inc M /trunk/packages/fcl-res/src/rclex.l M /trunk/packages/fcl-res/src/rcparser.pas M /trunk/packages/fcl-res/src/rcparser.y - fix \ in filenames: * copy long_string to long_stringfn and long_string. * turn off interpretive I/O (escapes) for long_stringfn * use long_stringfn for filenames. * filenames also get unquoted production for Delphi compatibility using new non_whitespace_string. Regex for that is a bit t.b.d, but this made it work with my examples git-svn-id: branches/fixes_3_2@47904 -
This commit is contained in:
parent
ec6d8f71a2
commit
7f5361f301
File diff suppressed because it is too large
Load Diff
@ -63,6 +63,7 @@ O [0-7]
|
||||
D [0-9]
|
||||
H [0-9a-fA-F]
|
||||
IDENT [a-zA-Z_]([a-zA-Z0-9_])*
|
||||
NSWPSTR ([a-zA-Z0-9_\:\.\\])*
|
||||
|
||||
%%
|
||||
|
||||
@ -108,6 +109,7 @@ END|} return(_END);
|
||||
else
|
||||
return(_ID);
|
||||
end;
|
||||
{NSWPSTR} return(_NSWPSTR);
|
||||
[ \t\n\f] ;
|
||||
[,()|^&+-*/%~] returnc(yytext[1]);
|
||||
. return(_ILLEGAL);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -12,7 +12,7 @@ unit rcparser;
|
||||
%token _ILLEGAL
|
||||
%token _NUMBER _QUOTEDSTR _QUOTEDSTRL
|
||||
%token _STR_StringFileInfo _STR_VarFileInfo _STR_Translation
|
||||
%token _BEGIN _END _ID
|
||||
%token _BEGIN _END _ID _NSWPSTR
|
||||
%token _LANGUAGE _CHARACTERISTICS _VERSION _MOVEABLE _FIXED _PURE _IMPURE _PRELOAD _LOADONCALL _DISCARDABLE
|
||||
%token _BITMAP _CURSOR _ICON _STRINGTABLE _VERSIONINFO
|
||||
%token _ANICURSOR _ANIICON _DLGINCLUDE _DLGINIT _HTML _MANIFEST _MESSAGETABLE _PLUGPLAY _RCDATA _VXD
|
||||
@ -20,7 +20,7 @@ unit rcparser;
|
||||
%token _ACCELERATORS _DIALOG _DIALOGEX _MENU _MENUEX
|
||||
|
||||
%type <rcnumtype> numpos numexpr numeral
|
||||
%type <rcstrtype> ident_string long_string
|
||||
%type <rcstrtype> ident_string long_string non_whitespace_string long_stringfn
|
||||
%type <TResourceDesc> resid rcdataid
|
||||
%type <TMemoryStream> raw_data raw_item
|
||||
%type <TFileStream> filename_string
|
||||
@ -188,8 +188,21 @@ ident_string
|
||||
| long_string
|
||||
;
|
||||
|
||||
non_whitespace_string
|
||||
: _NSWPSTR { string_new($$, yytext, opt_code_page); }
|
||||
;
|
||||
|
||||
filename_string
|
||||
: long_string { $$:= TFileStream.Create($1.v^, fmOpenRead or fmShareDenyWrite); }
|
||||
: long_stringfn { $$:= TFileStream.Create($1.v^, fmOpenRead or fmShareDenyWrite); }
|
||||
| non_whitespace_string { $$:= TFileStream.Create($1.v^, fmOpenRead or fmShareDenyWrite); }
|
||||
;
|
||||
|
||||
long_stringfn
|
||||
: _QUOTEDSTR { string_new_uni($$, @strbuf[0], strbuflen, opt_code_page, false); }
|
||||
| _QUOTEDSTRL { string_new_uni($$, @strbuf[0], strbuflen, CP_UTF16, false); }
|
||||
| _STR_StringFileInfo { string_new($$, yytext, opt_code_page); }
|
||||
| _STR_VarFileInfo { string_new($$, yytext, opt_code_page); }
|
||||
| _STR_Translation { string_new($$, yytext, opt_code_page); }
|
||||
;
|
||||
|
||||
long_string
|
||||
|
Loading…
Reference in New Issue
Block a user