| @@ 1013-1069 (lines=57) @@ | ||
| 1010 | return result0; |
|
| 1011 | } |
|
| 1012 | ||
| 1013 | function parse_attrName() { |
|
| 1014 | var cacheKey = "attrName@" + pos; |
|
| 1015 | var cachedResult = cache[cacheKey]; |
|
| 1016 | if (cachedResult) { |
|
| 1017 | pos = cachedResult.nextPos; |
|
| 1018 | return cachedResult.result; |
|
| 1019 | } |
|
| 1020 | ||
| 1021 | var result0, result1; |
|
| 1022 | var pos0; |
|
| 1023 | ||
| 1024 | pos0 = pos; |
|
| 1025 | result1 = parse_identifierName(); |
|
| 1026 | if (result1 === null) { |
|
| 1027 | if (input.charCodeAt(pos) === 46) { |
|
| 1028 | result1 = "."; |
|
| 1029 | pos++; |
|
| 1030 | } else { |
|
| 1031 | result1 = null; |
|
| 1032 | if (reportFailures === 0) { |
|
| 1033 | matchFailed("\".\""); |
|
| 1034 | } |
|
| 1035 | } |
|
| 1036 | } |
|
| 1037 | if (result1 !== null) { |
|
| 1038 | result0 = []; |
|
| 1039 | while (result1 !== null) { |
|
| 1040 | result0.push(result1); |
|
| 1041 | result1 = parse_identifierName(); |
|
| 1042 | if (result1 === null) { |
|
| 1043 | if (input.charCodeAt(pos) === 46) { |
|
| 1044 | result1 = "."; |
|
| 1045 | pos++; |
|
| 1046 | } else { |
|
| 1047 | result1 = null; |
|
| 1048 | if (reportFailures === 0) { |
|
| 1049 | matchFailed("\".\""); |
|
| 1050 | } |
|
| 1051 | } |
|
| 1052 | } |
|
| 1053 | } |
|
| 1054 | } else { |
|
| 1055 | result0 = null; |
|
| 1056 | } |
|
| 1057 | if (result0 !== null) { |
|
| 1058 | result0 = (function(offset, i) { return i.join(''); })(pos0, result0); |
|
| 1059 | } |
|
| 1060 | if (result0 === null) { |
|
| 1061 | pos = pos0; |
|
| 1062 | } |
|
| 1063 | ||
| 1064 | cache[cacheKey] = { |
|
| 1065 | nextPos: pos, |
|
| 1066 | result: result0 |
|
| 1067 | }; |
|
| 1068 | return result0; |
|
| 1069 | } |
|
| 1070 | ||
| 1071 | function parse_attrValue() { |
|
| 1072 | var cacheKey = "attrValue@" + pos; |
|
| @@ 956-1011 (lines=56) @@ | ||
| 953 | return result0; |
|
| 954 | } |
|
| 955 | ||
| 956 | function parse_attrEqOps() { |
|
| 957 | var cacheKey = "attrEqOps@" + pos; |
|
| 958 | var cachedResult = cache[cacheKey]; |
|
| 959 | if (cachedResult) { |
|
| 960 | pos = cachedResult.nextPos; |
|
| 961 | return cachedResult.result; |
|
| 962 | } |
|
| 963 | ||
| 964 | var result0, result1; |
|
| 965 | var pos0, pos1; |
|
| 966 | ||
| 967 | pos0 = pos; |
|
| 968 | pos1 = pos; |
|
| 969 | if (input.charCodeAt(pos) === 33) { |
|
| 970 | result0 = "!"; |
|
| 971 | pos++; |
|
| 972 | } else { |
|
| 973 | result0 = null; |
|
| 974 | if (reportFailures === 0) { |
|
| 975 | matchFailed("\"!\""); |
|
| 976 | } |
|
| 977 | } |
|
| 978 | result0 = result0 !== null ? result0 : ""; |
|
| 979 | if (result0 !== null) { |
|
| 980 | if (input.charCodeAt(pos) === 61) { |
|
| 981 | result1 = "="; |
|
| 982 | pos++; |
|
| 983 | } else { |
|
| 984 | result1 = null; |
|
| 985 | if (reportFailures === 0) { |
|
| 986 | matchFailed("\"=\""); |
|
| 987 | } |
|
| 988 | } |
|
| 989 | if (result1 !== null) { |
|
| 990 | result0 = [result0, result1]; |
|
| 991 | } else { |
|
| 992 | result0 = null; |
|
| 993 | pos = pos1; |
|
| 994 | } |
|
| 995 | } else { |
|
| 996 | result0 = null; |
|
| 997 | pos = pos1; |
|
| 998 | } |
|
| 999 | if (result0 !== null) { |
|
| 1000 | result0 = (function(offset, a) { return a + '='; })(pos0, result0[0]); |
|
| 1001 | } |
|
| 1002 | if (result0 === null) { |
|
| 1003 | pos = pos0; |
|
| 1004 | } |
|
| 1005 | ||
| 1006 | cache[cacheKey] = { |
|
| 1007 | nextPos: pos, |
|
| 1008 | result: result0 |
|
| 1009 | }; |
|
| 1010 | return result0; |
|
| 1011 | } |
|
| 1012 | ||
| 1013 | function parse_attrName() { |
|
| 1014 | var cacheKey = "attrName@" + pos; |
|
| @@ 765-812 (lines=48) @@ | ||
| 762 | return result0; |
|
| 763 | } |
|
| 764 | ||
| 765 | function parse_identifier() { |
|
| 766 | var cacheKey = "identifier@" + pos; |
|
| 767 | var cachedResult = cache[cacheKey]; |
|
| 768 | if (cachedResult) { |
|
| 769 | pos = cachedResult.nextPos; |
|
| 770 | return cachedResult.result; |
|
| 771 | } |
|
| 772 | ||
| 773 | var result0, result1; |
|
| 774 | var pos0, pos1; |
|
| 775 | ||
| 776 | pos0 = pos; |
|
| 777 | pos1 = pos; |
|
| 778 | if (input.charCodeAt(pos) === 35) { |
|
| 779 | result0 = "#"; |
|
| 780 | pos++; |
|
| 781 | } else { |
|
| 782 | result0 = null; |
|
| 783 | if (reportFailures === 0) { |
|
| 784 | matchFailed("\"#\""); |
|
| 785 | } |
|
| 786 | } |
|
| 787 | result0 = result0 !== null ? result0 : ""; |
|
| 788 | if (result0 !== null) { |
|
| 789 | result1 = parse_identifierName(); |
|
| 790 | if (result1 !== null) { |
|
| 791 | result0 = [result0, result1]; |
|
| 792 | } else { |
|
| 793 | result0 = null; |
|
| 794 | pos = pos1; |
|
| 795 | } |
|
| 796 | } else { |
|
| 797 | result0 = null; |
|
| 798 | pos = pos1; |
|
| 799 | } |
|
| 800 | if (result0 !== null) { |
|
| 801 | result0 = (function(offset, i) { return { type: 'identifier', value: i }; })(pos0, result0[1]); |
|
| 802 | } |
|
| 803 | if (result0 === null) { |
|
| 804 | pos = pos0; |
|
| 805 | } |
|
| 806 | ||
| 807 | cache[cacheKey] = { |
|
| 808 | nextPos: pos, |
|
| 809 | result: result0 |
|
| 810 | }; |
|
| 811 | return result0; |
|
| 812 | } |
|
| 813 | ||
| 814 | function parse_attr() { |
|
| 815 | var cacheKey = "attr@" + pos; |
|