Fixed: #2325 AS3 direct editation - allow single quoted attributes in XML

This commit is contained in:
Jindra Petřík
2024-09-26 19:47:46 +02:00
parent 4efa3191e7
commit ce2ac52ba1
6 changed files with 868 additions and 853 deletions

View File

@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file.
- [#2322] AS3 Assigment position when using dup
- [#2323] AS3 direct editation - Number class traits are duplicated in constructor
- [#2324] AS3 direct editation - nested loop continue/break (with labels)
- [#2325] AS3 direct editation - allow single quoted attributes in XML
## [21.1.0] - 2024-09-23
### Added
@@ -3590,6 +3591,7 @@ Major version of SWF to XML export changed to 2.
[#2322]: https://www.free-decompiler.com/flash/issues/2322
[#2323]: https://www.free-decompiler.com/flash/issues/2323
[#2324]: https://www.free-decompiler.com/flash/issues/2324
[#2325]: https://www.free-decompiler.com/flash/issues/2325
[#943]: https://www.free-decompiler.com/flash/issues/943
[#1812]: https://www.free-decompiler.com/flash/issues/1812
[#2287]: https://www.free-decompiler.com/flash/issues/2287

Binary file not shown.

View File

@@ -539,6 +539,10 @@ RegExp = \/([^\r\n/]|\\\/)+\/[a-z]*
yybegin(XMLOPENTAG);
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE, yytext());
}
\'{XmlSQuoteStringChar}*\' {
yybegin(XMLOPENTAG);
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRIBUTEVALUE_SINGLEQUOTED, yytext());
}
"{" {
yybegin(YYINITIAL);
return new ParsedSymbol(SymbolGroup.XML, SymbolType.XML_ATTRVALVAR_BEGIN, yytext());

View File

@@ -556,9 +556,13 @@ public enum SymbolType {
*/
XML_ATTRIBUTENAME(GraphTargetItem.PRECEDENCE_PRIMARY, false), // aaa=
/**
* XML: attribute value
* XML: attribute value, double quoted
*/
XML_ATTRIBUTEVALUE(GraphTargetItem.PRECEDENCE_PRIMARY, false), // "vvv"
/**
* XML: attribute value, single quoted
*/
XML_ATTRIBUTEVALUE_SINGLEQUOTED(GraphTargetItem.PRECEDENCE_PRIMARY, false), // 'vvv'
/**
* XML: text
*/

View File

@@ -113,7 +113,7 @@ TypeNameSpec = ".<" {Identifier} ">"
/* XML */
LetterColon = [:jletter] | ":"
XMLIdentifier = {Identifier} | {IdentifierNs}
XMLAttribute = " "* {XMLIdentifier} " "* "=" " "* \" {InputCharacter}* \" " "*
XMLAttribute = " "* {XMLIdentifier} " "* "=" " "* (\" {InputCharacter}* \" | "'" {InputCharacter}* "'") " "*
XMLBeginOneTag = "<" {XMLIdentifier} {XMLAttribute}* ">" | "<{" {XMLIdentifier} "}" {XMLAttribute}* " "* ">"
XMLBeginTag = "<" {XMLIdentifier} " " | "<{" {XMLIdentifier} "} "
XMLEndTag = "</" {XMLIdentifier} " "* ">" | "</{" {XMLIdentifier} "}" " "* ">"