Separate xml rule from main script
Change-Id: I983e69b8e5bc338c76e607df7fd07b6b85004f34
diff --git a/src/entities.xfst b/src/entities.xfst
index 92430ef..f185e31 100644
--- a/src/entities.xfst
+++ b/src/entities.xfst
@@ -1,5 +1,5 @@
define XMLentitiesDec ["#" Digit Digit+ ];
define XMLentitiesHex ["#" ["x"|"X"] HexLetter HexLetter+ ];
-define XMLentitiesStr [[[AsciiLetter .o. Caseinsensitive].l | Digit | "_" | "-" ]+ ];
+define XMLentitiesStr [[[AsciiLetter .o. Caseinsensitive].l | Digit | "_" | "-" ] ];
-read regex ["&" [XMLentitiesDec|XMLentitiesHex|XMLentitiesStr] ";"];
\ No newline at end of file
+read regex ["&" [XMLentitiesDec|XMLentitiesHex|XMLentitiesStr XMLentitiesStr+] ";"];
\ No newline at end of file
diff --git a/src/tokenizer.xfst b/src/tokenizer.xfst
index 30d06e8..9a3c2f4 100644
--- a/src/tokenizer.xfst
+++ b/src/tokenizer.xfst
@@ -143,25 +143,9 @@
define Domain Char+ [Dash Char+]* Dot TldEnd;
-! XML rule
-define XMLns [AsciiLetter [AsciiLetter|Digit|%-]* (%: AsciiLetter [AsciiLetter|Digit|%-]*)] .o. Caseinsensitive;
-define XML [
- "<" [
- [
- XMLns
- [WS+ XMLns WS*
- (%= WS*
- [[%" [? - %" - %>]+ %"] | [%' [? - %' - %>]+ %']]
- )
- ]*
- (WS* "/")
- ]
- |
- [
- "/" XMLns
- ]
- ] WS* ">"
-].u;
+! XML sources
+source xml.xfst
+define XML;
! XML entities
source entities.xfst
diff --git a/src/xml.xfst b/src/xml.xfst
new file mode 100644
index 0000000..1c7421f
--- /dev/null
+++ b/src/xml.xfst
@@ -0,0 +1,19 @@
+! XML rule
+define XMLns [AsciiLetter [AsciiLetter|Digit|%-]* (%: AsciiLetter [AsciiLetter|Digit|%-]*)] .o. Caseinsensitive;
+read regex [
+ "<" [
+ [
+ XMLns
+ [WS+ XMLns WS*
+ (%= WS*
+ [[%" [? - %" - %>]+ %"] | [%' [? - %' - %>]+ %']]
+ )
+ ]*
+ (WS* "/")
+ ]
+ |
+ [
+ "/" XMLns
+ ]
+ ] WS* ">"
+].u;