Changeset 1990067
- Timestamp:
- 12/09/2018 05:41:36 PM (7 years ago)
- Location:
- easycoder/trunk
- Files:
-
- 1 added
- 9 edited
-
easycoder-min.js (modified) (2 diffs)
-
easycoder.js (modified) (4 diffs)
-
easycoder.php (modified) (3 diffs)
-
ec-rest.txt (added)
-
plugins/browser.js (modified) (28 diffs)
-
plugins/ckeditor.js (modified) (3 diffs)
-
plugins/json.js (modified) (9 diffs)
-
plugins/svg.js (modified) (9 diffs)
-
readme.txt (modified) (1 diff)
-
rest.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
easycoder/trunk/easycoder-min.js
r1987906 r1990067 18 18 a.rewind()}console.log("No handler found");throw Error("I don't understand '"+c+"...'");}},compileOne:function(){var c=a.getToken();if(c){b.warnings=[];var m=b.program.length;c.endsWith(":")?(b.symbols[c.substring(0,c.length-1)]={pc:m},b.index++):a.compileToken()}},compileFromHere:function(c){for(;b.index<b.tokens.length;){var m=b.tokens[b.index].token;if("else"===m)return b.program;a.compileOne();if(-1<c.indexOf(m))break}},compile:function(c){b.tokens=c;b.index=0;b.program=[];b.symbols={};b.warnings= 19 19 [];a.compileFromHere([]);a.addCommand({domain:"core",keyword:"stop",lino:a.getLino(),next:0});return b.program}};g.exports=a},{}],4:[function(d,g,f){var e=Object.assign||function(b){for(var a=1;a<arguments.length;a++){var c=arguments[a],m;for(m in c)Object.prototype.hasOwnProperty.call(c,m)&&(b[m]=c[m])}return b};g.exports={compile:function(b){b.mark();for(var a=$jscomp.makeIterator(Object.keys(b.domain)),c=a.next();!c.done;c=a.next()){if(c=b.domain[c.value].condition.compile(b))return e({domain:name}, 20 c);b.rewind()}},test:function(b,a){return b.domain[a.domain].condition.test(b,a)}}},{}],5:[function(d,g,f){var e=this,b={Add:{compile:function(a){var c=a.getLino() ,b=a.getNextValue();if(a.tokenIs("to"))if(a.next(),a.getToken(),a.isSymbol()){var h=a.getSymbol();if(a.getCommandAt(h.pc).isValueHolder){if("giving"===a.peek()){h=a.getValue();a.next();var d=a.getToken();a.next();a.addCommand({domain:"core",keyword:"add",lino:c,value1:b,value2:h,target:d})}else h=a.getToken(),a.next(),a.addCommand({domain:"core",20 c);b.rewind()}},test:function(b,a){return b.domain[a.domain].condition.test(b,a)}}},{}],5:[function(d,g,f){var e=this,b={Add:{compile:function(a){var c=a.getLino();a.next();var b=a.getValue();if(a.tokenIs("to"))if(a.next(),a.getToken(),a.isSymbol()){var h=a.getSymbol();if(a.getCommandAt(h.pc).isValueHolder){if("giving"===a.peek()){h=a.getValue();a.next();var d=a.getToken();a.next();a.addCommand({domain:"core",keyword:"add",lino:c,value1:b,value2:h,target:d})}else h=a.getToken(),a.next(),a.addCommand({domain:"core", 21 21 keyword:"add",lino:c,value1:b,target:h});return!0}a.warning("core "+e.name+": Expected value holder")}else{h=a.getValue();if(a.tokenIs("giving"))return a.next(),d=a.getToken(),a.next(),a.addCommand({domain:"core",keyword:"add",lino:c,value1:b,value2:h,target:d}),!0;a.warning("core "+e.name+': Expected "giving"')}return!1},run:function(a){var c=a[a.pc],b=c.value1,h=c.value2,d=a.getSymbolRecord(c.target);if(d.isValueHolder){var e=d.value[d.index];h?(a=a.getValue(h)+a.getValue(b),d.value[d.index]={type:"constant", 22 22 numeric:!0,content:a}):(e.numeric||a.nonNumericValueError(c.lino),a=e.content+a.getValue(b),d.value[d.index]={type:"constant",numeric:!0,content:a})}else a.VariableDoesNotHoldAValueError(c.lino,d.name);return c.pc+1}},Alias:{compile:function(a){var c=a.getLino();a.next();if(a.isSymbol()){var b=a.getToken();a.next();if(a.tokenIs("to")&&(a.next(),a.isSymbol())){var d=a.getToken();a.next();a.addCommand({domain:"core",keyword:"alias",lino:c,alias:b,symbol:d});return!0}}return!1},run:function(a){var c= … … 75 75 this.getSymbolRecord;d.runtimeError=this.runtimeError;d.nonNumericValueError=this.nonNumericValueError;d.variableDoesNotHoldAValueError=this.variableDoesNotHoldAValueError;d.reportError=this.reportError;d.register=this.register;d.symbols=a.getSymbols();d.encoding="ec";d.popups=[];d.stack=[];d.queue=[0];d.module=e;d.parent=f;e&&(e.program=d);this.setupTracer();c(d,0)},tokeniseScript:function(a,c,d,e){var f=Date.now();a=b.tokenise(a);var h=Date.now();console.log("Tokenised "+a.scriptLines.length+" lines in "+ 76 76 (h-f+" ms"));try{l.compileScript(a,c,d,e)}catch(t){"stop"!==t.message&&this.reportError(t,l.program,a)}},tokenize:function(a){a=a.split("\n");if(!e.tokenising){try{l.tokeniseScript(a)}catch(p){l.reportError(p)}e.tokenising=!0}},setPluginCount:function(a){e.plugins=[];e.pluginCount=a},checkPlugin:function(a){return l.domain[a]},getPlugin:function(a,b,c){l.domain[a]?c():(a=document.createElement("script"),a.type="text/javascript",a.src=b,a.onload=function(){console.log("Plugin "+b+" loaded");c()},document.head.appendChild(a))}, 77 addGlobalPlugin:function(a,b){e.plugins.push({name:a,handler:b});e.plugins.length===e.pluginCount&&(e.plugins.forEach(function(a){l.domain[a.name]=a.handler}),l.tokenize(e.source))},addLocalPlugin:function(a,b,c){l.domain[a]=b;c()},getPluginsPath:function(){return l.pluginsPath},loadPluginJs:function(a){var b=new XMLHttpRequest;b.open("GET",""+window.location.origin+a+"/ wp-content/plugins/easycoder/plugins.js",!0);b.onreadystatechange=function(){if(4===b.readyState)switch(b.status){case 200:var c=78 document.createElement("script");c.src=""+window.location.origin+a+"/wp-content/plugins/easycoder/plugins.js";c.type="text/javascript";c.onload=function(){EasyCoder_Plugins.getGlobalPlugins(a,l.setPluginCount,l.getPlugin,l.addGlobalPlugin)};document.head.appendChild(c);l.pluginsPath=a;break;case 404:a?l.loadPluginJs(a.slice(0,a.lastIndexOf("/"))):l.reportError({message:"Can't load plugins.js"},l.program,this.source)}};b.send()},start:function(a){e.source=a;a=window.location.pathname;a.endsWith("/")&& 79 (a=a.slice(0,-1));l.loadPluginJs(a)}};g.exports=l},{"./Compare":2,"./Compile":3,"./Condition":4,"./Core":5,"./Run":7,"./Tokenise":8,"./Value":9}],7:[function(d,g,f){var e=function(b,a){var c=[],d=function(a){var b=9999;a.forEach(function(a){a=a.line;for(var c=0;c<a.length&&" "===a[c];)c++;0<c&&c<b&&(b=c)});return 0};if(c.length)c.push(a);else for(b.register(b),c.push(a);0<c.length&&!EasyCoder.aborted;)for(b.pc=c.shift(),b.watchdog=0,a={};;){if(1E6<b.watchdog){b.lino=b[b.pc].lino;b.reportError(Error("Program runaway intercepted.\nHave you forgotten to increment a loop counter?"),77 addGlobalPlugin:function(a,b){e.plugins.push({name:a,handler:b});e.plugins.length===e.pluginCount&&(e.plugins.forEach(function(a){l.domain[a.name]=a.handler}),l.tokenize(e.source))},addLocalPlugin:function(a,b,c){l.domain[a]=b;c()},getPluginsPath:function(){return l.pluginsPath},loadPluginJs:function(a){var b=new XMLHttpRequest;b.open("GET",""+window.location.origin+a+"/easycoder/plugins.js",!0);b.onreadystatechange=function(){if(4===b.readyState)switch(b.status){case 200:var c=document.createElement("script"); 78 c.src=""+window.location.origin+a+"/easycoder/plugins.js";c.type="text/javascript";c.onload=function(){EasyCoder_Plugins.getGlobalPlugins(a,l.setPluginCount,l.getPlugin,l.addGlobalPlugin)};document.head.appendChild(c);l.pluginsPath=a;break;case 404:a?l.loadPluginJs(a.slice(0,a.lastIndexOf("/"))):l.reportError({message:"Can't load plugins.js"},l.program,this.source)}};b.send()},start:function(a){e.source=a;a=window.location.pathname;a.endsWith("/")&&(a=a.slice(0,-1));l.loadPluginJs(a)}};g.exports= 79 l},{"./Compare":2,"./Compile":3,"./Condition":4,"./Core":5,"./Run":7,"./Tokenise":8,"./Value":9}],7:[function(d,g,f){var e=function(b,a){var c=[],d=function(a){var b=9999;a.forEach(function(a){a=a.line;for(var c=0;c<a.length&&" "===a[c];)c++;0<c&&c<b&&(b=c)});return 0};if(c.length)c.push(a);else for(b.register(b),c.push(a);0<c.length&&!EasyCoder.aborted;)for(b.pc=c.shift(),b.watchdog=0,a={};;){if(1E6<b.watchdog){b.lino=b[b.pc].lino;b.reportError(Error("Program runaway intercepted.\nHave you forgotten to increment a loop counter?"), 80 80 b);break}b.watchdog++;var f=b[b.pc].domain;b.debugStep&&console.log(b.script+" "+b.pc+" "+f+":"+b[b.pc].keyword);var g=b.domain[f];if(!g){b.runtimeError(b[b.pc].lino,"Unknown domain '"+f+"'");break}b.pc=g.run(b);if(!b.pc)break;if(b.stop){b.tracing=!1;return}if(b.tracing){f=b[b.pc];g=b.source.scriptLines;var l=d(g),n=document.getElementById("easycoder-tracer");if(n){n.style.display="block";n.style.visibility="visible";var p="";if(b.tracer){b.tracer.variables.forEach(function(a,c,d){var e=b.getSymbolRecord(a); 81 81 if(1<e.elements)for(p+=a+": "+e.index+"/"+e.elements+": ",a=0;a<e.elements;a++){var f=e.value[a];p=f?p+(f.content+" "):p+"undefined "}else p=(e=e.value[e.index])?p+(a+": "+e.content):p+(a+": undefined");switch(b.tracer.alignment){case "horizontal":c<d.length-1&&(p+=", ");break;case "vertical":p+="<br>"}});p+="<hr>";n="";for(var q=5;0<q;q--)f.lino&&(n+='<input type="text" name="'+q+'"'+('value="'+g[f.lino-q].line.substr(l)+'"')+'style="width:100%;border:none;enabled:false">'),n+="<br>";f=document.getElementById("easycoder-tracer-content"); -
easycoder/trunk/easycoder.js
r1987906 r1990067 343 343 compile: compiler => { 344 344 const lino = compiler.getLino(); 345 compiler.next(); 345 346 // Get the (first) value 346 const value1 = compiler.get NextValue();347 const value1 = compiler.getValue(); 347 348 if (compiler.tokenIs('to')) { 348 349 compiler.next(); … … 2827 2828 2828 2829 loadPluginJs: pathname => { 2829 const fullPath = `${window.location.origin}${pathname}/ wp-content/plugins/easycoder/plugins.js`;2830 const fullPath = `${window.location.origin}${pathname}/easycoder/plugins.js`; 2830 2831 const ajax = new XMLHttpRequest(); 2831 2832 ajax.open('GET', fullPath, true); … … 2835 2836 case 200: 2836 2837 const script = document.createElement('script'); 2837 script.src = `${window.location.origin}${pathname}/ wp-content/plugins/easycoder/plugins.js`;2838 script.src = `${window.location.origin}${pathname}/easycoder/plugins.js`; 2838 2839 script.type = 'text/javascript'; 2839 2840 script.onload = function () { … … 3005 3006 EasyCoder_Run(program, program.resume); 3006 3007 } catch (err) { 3007 const message = `Error in step handler: ${err.message}`;3008 const message = 'Error in step handler: ' + err.message; 3008 3009 console.log(message); 3009 3010 alert(message); -
easycoder/trunk/easycoder.php
r1987798 r1990067 4 4 * Plugin URI: https://easycoder.software 5 5 * Description: Control the appearance and behavior of your posts and pages by embedding simple English-like scripts, without the need to learn JavaScript. 6 * Version: 2.1. 66 * Version: 2.1.7 7 7 * Author: EasyCoder Software 8 8 * Author URI: https://easycoder.software … … 17 17 function easycoder_enqueue_script() { 18 18 wp_enqueue_script('easycoder_script', plugin_dir_url( __FILE__ ) 19 . 'easycoder-min.js', array(), '2.1. 6');19 . 'easycoder-min.js', array(), '2.1.7'); 20 20 } 21 21 … … 24 24 function setup_default_files() { 25 25 $pluginDir = plugin_dir_path( __FILE__ ); 26 if (!file_exists($pluginDir . 'plugins.js')) { 27 rename($pluginDir . 'plugins-sample.js', $pluginDir . 'plugins.js'); 26 27 mkdir(ABSPATH . 'easycoder'); 28 if (!file_exists(ABSPATH . 'easycoder/plugins.js')) { 29 copy($pluginDir . 'plugins-sample.js', ABSPATH . 'easycoder/plugins.js'); 28 30 } 29 if (!file_exists( $pluginDir . 'rest-local.php')) {30 rename($pluginDir . 'rest-local-sample.php', $pluginDir . 'rest-local.php');31 if (!file_exists(ABSPATH . 'easycoder/rest-local.php')) { 32 copy($pluginDir . 'rest-local-sample.php', ABSPATH . 'easycoder/rest-local.php'); 31 33 } 32 34 } -
easycoder/trunk/plugins/browser.js
r1986782 r1990067 17 17 compile: (compiler) => { 18 18 const lino = compiler.getLino(); 19 compiler.next(); 20 const value = compiler.getValue(); 19 const value = compiler.getNextValue(); 21 20 compiler.addCommand({ 22 21 domain: 'browser', … … 32 31 const value = program.getValue(command.value); 33 32 alert(value); 34 return program[program.pc].pc + 1;33 return command.pc + 1; 35 34 } 36 35 }, … … 62 61 compiler.next(); 63 62 if (compiler.tokenIs('to')) { 64 compiler.next(); 65 const cssId = compiler.getValue(); 63 const cssId = compiler.getNextValue(); 66 64 compiler.addCommand({ 67 65 domain: 'browser', … … 144 142 compile: (compiler) => { 145 143 const lino = compiler.getLino(); 146 compiler.next(); 147 if (compiler.isSymbol()) { 144 if (compiler.nextIsSymbol()) { 148 145 const symbolRecord = compiler.getSymbolRecord(); 149 146 const target = symbolRecord.name; … … 277 274 break; 278 275 } 279 return program[program.pc].pc + 1;276 return command.pc + 1; 280 277 } 281 278 }, … … 285 282 compile: (compiler) => { 286 283 const lino = compiler.getLino(); 287 compiler.next(); 288 if (compiler.isSymbol()) { 284 if (compiler.nextIsSymbol()) { 289 285 const symbol = compiler.getToken(); 290 286 compiler.next(); … … 326 322 compile: (compiler) => { 327 323 const lino = compiler.getLino(); 328 compiler.next(); 329 if (compiler.isSymbol()) { 324 if (compiler.nextIsSymbol()) { 330 325 const symbol = compiler.getToken(); 331 326 compiler.next(); … … 489 484 compile: (compiler) => { 490 485 const lino = compiler.getLino(); 491 compiler.next();492 486 var newWindow = false; 493 if (compiler. tokenIs('new')) {487 if (compiler.nextTokenIs('new')) { 494 488 newWindow = true; 495 489 compiler.next(); … … 521 515 compile: (compiler) => { 522 516 const lino = compiler.getLino(); 523 compiler.next(); 524 if (compiler.tokenIs('to')) { 525 compiler.next(); 526 const to = compiler.getValue(); 517 if (compiler.nextTokenIs('to')) { 518 const to = compiler.getNextValue(); 527 519 var subject = ''; 528 520 var body = ''; 529 521 if (compiler.tokenIs('subject')) { 530 compiler.next(); 531 subject = compiler.getValue(); 522 subject = compiler.getNextValue(); 532 523 if (compiler.tokenIs('body') || compiler.tokenIs('message')) { 533 524 compiler.next(); … … 564 555 compile: (compiler) => { 565 556 const lino = compiler.getLino(); 566 compiler.next(); 567 const action = compiler.getToken(); 557 const action = compiler.nextToken(); 568 558 switch (action) { 569 559 case 'change': 570 560 case 'click': 571 compiler.next(); 572 if (compiler.isSymbol()) { 561 if (compiler.nextIsSymbol()) { 573 562 const symbol = compiler.getSymbolRecord(); 574 563 compiler.next(); … … 718 707 compile: (compiler) => { 719 708 const lino = compiler.getLino(); 720 compiler.next(); 721 if (compiler.isSymbol()) { 709 if (compiler.nextIsSymbol()) { 722 710 const targetRecord = compiler.getSymbolRecord(); 723 711 if (targetRecord.keyword === 'audioclip') { … … 740 728 const url = program.value.evaluate(program, targetRecord.value[targetRecord.index]).content; 741 729 new Audio(url).play(); 730 return command.pc + 1; 731 } 732 }, 733 734 Popup: { 735 736 compile: (compiler) => { 737 const item = compiler.compileVariable('browser', 'popup'); 738 return true; 739 }, 740 741 run: (program) => { 742 742 return program[program.pc].pc + 1; 743 743 } 744 744 }, 745 745 746 P opup: {747 748 compile: (compiler) => { 749 const item = compiler.compileVariable('browser', 'p opup');746 PRE: { 747 748 compile: (compiler) => { 749 const item = compiler.compileVariable('browser', 'pre', false, 'dom'); 750 750 return true; 751 751 }, … … 756 756 }, 757 757 758 PRE: {759 760 compile: (compiler) => {761 const item = compiler.compileVariable('browser', 'pre', false, 'dom');762 return true;763 },764 765 run: (program) => {766 return program[program.pc].pc + 1;767 }768 },769 770 758 Prompt: { 771 759 772 760 compile: (compiler) => { 773 761 const lino = compiler.getLino(); 774 compiler.next(); 775 const text = compiler.getValue(); 762 const text = compiler.getNextValue(); 776 763 if (compiler.tokenIs('with')) { 777 compiler.next(); 778 const pre = compiler.getValue(); 764 const pre = compiler.getNextValue(); 779 765 compiler.addCommand({ 780 766 domain: 'browser', … … 801 787 compile: (compiler) => { 802 788 const lino = compiler.getLino(); 803 compiler.next();804 789 // Get the value 805 const value = compiler.get Value();790 const value = compiler.getNextValue(); 806 791 if (compiler.tokenIs('into')) { 807 compiler.next(); 808 if (compiler.tokenIs('storage')) { 809 compiler.next(); 810 if (compiler.tokenIs('as')) { 811 compiler.next(); 812 const key = compiler.getValue(); 792 if (compiler.nextTokenIs('storage')) { 793 if (compiler.nextTokenIs('as')) { 794 const key = compiler.getNextValue(); 813 795 compiler.addCommand({ 814 796 domain: 'browser', … … 850 832 compile: (compiler) => { 851 833 const lino = compiler.getLino(); 852 compiler.next(); 853 if (compiler.isSymbol()) { 834 if (compiler.nextIsSymbol()) { 854 835 const target = compiler.getToken(); 855 compiler.next(); 856 if (compiler.tokenIs('from')) { 857 compiler.next(); 858 if (compiler.isSymbol()) { 836 if (compiler.nextTokenIs('from')) { 837 if (compiler.nextIsSymbol()) { 859 838 const source = compiler.getToken(); 860 839 compiler.next(); … … 873 852 var token = compiler.getToken(); 874 853 if (token === 'the') { 875 compiler.next(); 876 token = compiler.getToken(); 854 token = compiler.nextToken(); 877 855 } 878 856 if (token === 'title') { … … 888 866 return true; 889 867 } else if (token === 'content') { 890 compiler.next(); 891 if (compiler.tokenIs('of')) { 868 if (compiler.nextTokenIs('of')) { 892 869 compiler.next(); 893 870 if (compiler.isSymbol()) { 894 871 const target = compiler.getToken(); 895 compiler.next(); 896 if (compiler.tokenIs('from')) { 897 compiler.next(); 898 if (compiler.isSymbol()) { 872 if (compiler.nextTokenIs('from')) { 873 if (compiler.nextIsSymbol()) { 899 874 const source = compiler.getToken(); 900 875 compiler.next(); … … 911 886 } 912 887 if (compiler.tokenIs('to')) { 913 compiler.next(); 914 const value = compiler.getValue(); 888 const value = compiler.getNextValue(); 915 889 compiler.addCommand({ 916 890 domain: 'browser', … … 927 901 } 928 902 } else if (token === 'text') { 929 compiler.next(); 930 if (compiler.tokenIs('of')) { 903 if (compiler.nextTokenIs('of')) { 931 904 compiler.next(); 932 905 if (compiler.isSymbol()) { … … 935 908 case 'button': 936 909 case 'input': 937 compiler.next(); 938 if (compiler.tokenIs('to')) { 910 if (compiler.nextTokenIs('to')) { 939 911 compiler.next(); 940 912 const value = compiler.getValue(); … … 956 928 } 957 929 } else if (token === 'size') { 958 compiler.next(); 959 if (compiler.tokenIs('of')) { 930 if (compiler.nextTokenIs('of')) { 960 931 compiler.next(); 961 932 if (compiler.isSymbol()) { … … 965 936 compiler.next(); 966 937 if (compiler.tokenIs('to')) { 967 compiler.next(); 968 const value = compiler.getValue(); 938 const value = compiler.getNextValue(); 969 939 compiler.addCommand({ 970 940 domain: 'browser', … … 984 954 const attributeName = compiler.getValue(); 985 955 if (compiler.tokenIs('of')) { 986 compiler.next(); 987 if (compiler.isSymbol()) { 956 if (compiler.nextIsSymbol()) { 988 957 const symbolName = compiler.getToken(); 989 958 compiler.next(); … … 993 962 }; 994 963 if (compiler.tokenIs('to')) { 995 compiler.next(); 996 attributeValue = compiler.getValue(); 964 attributeValue = compiler.getNextValue(); 997 965 } 998 966 compiler.addCommand({ … … 1009 977 } 1010 978 } else if (token === 'style') { 1011 compiler.next(); 1012 const styleName = compiler.getValue(); 979 const styleName = compiler.getNextValue(); 1013 980 var type = 'setStyle'; 1014 981 var symbolName = ''; 1015 982 if (compiler.tokenIs('of')) { 1016 compiler.next(); 1017 if (compiler. getToken() === 'body') {983 984 if (compiler.nextToken() === 'body') { 1018 985 type = 'setBodyStyle'; 1019 986 } else if (compiler.isSymbol()) { … … 1024 991 compiler.next(); 1025 992 if (compiler.tokenIs('to')) { 1026 compiler.next(); 1027 const styleValue = compiler.getValue(); 993 const styleValue = compiler.getNextValue(); 1028 994 if (styleValue) { 1029 995 compiler.addCommand({ … … 1190 1156 compile: (compiler) => { 1191 1157 const lino = compiler.getLino(); 1192 compiler.next();1193 1158 const variables = []; 1194 if (compiler. isSymbol()) {1159 if (compiler.nextIsSymbol()) { 1195 1160 while (compiler.isSymbol()) { 1196 1161 variables.push(compiler.getToken()); … … 1263 1228 compile: (compiler) => { 1264 1229 const lino = compiler.getLino(); 1265 compiler.next(); 1266 const file = compiler.getValue(); 1230 const file = compiler.getNextValue(); 1267 1231 if (compiler.tokenIs('to')) { 1268 compiler.next(); 1269 const path = compiler.getValue(); 1232 const path = compiler.getNextValue(); 1270 1233 if (compiler.tokenIs('with')) { 1271 compiler.next(); 1272 const progress = compiler.getValue(); 1234 const progress = compiler.getNextValue(); 1273 1235 if (compiler.tokenIs('and')) { 1274 compiler.next(); 1275 const status = compiler.getValue(); 1236 const status = compiler.getNextValue(); 1276 1237 compiler.addCommand({ 1277 1238 domain: 'browser', -
easycoder/trunk/plugins/ckeditor.js
r1986782 r1990067 5 5 compile: (compiler) => { 6 6 const lino = compiler.getLino(); 7 compiler.next(); 8 const action = compiler.getToken(); 7 const action = compiler.nextToken(); 9 8 compiler.next(); 10 9 switch (action) { 11 10 case 'append': 12 11 if (compiler.tokenIs('to')) { 13 compiler.next(); 14 if (compiler.isSymbol()) { 12 if (compiler.nextIsSymbol()) { 15 13 const appendVar = compiler.getToken(); 16 14 compiler.next(); … … 43 41 if (compiler.isSymbol()) { 44 42 const target = compiler.getToken(); 45 compiler.next(); 46 if (compiler.tokenIs('from')) { 43 if (compiler.nextTokenIs('from')) { 47 44 compiler.next(); 48 45 if (compiler.isSymbol()) { … … 65 62 if (compiler.isSymbol()) { 66 63 const editor = compiler.getToken(); 67 compiler.next(); 68 if (compiler.tokenIs('to')) { 69 compiler.next(); 70 const value = compiler.getValue(); 64 if (compiler.nextTokenIs('to')) { 65 const value = compiler.getNextValue(); 71 66 compiler.addCommand({ 72 67 domain: 'ckeditor', -
easycoder/trunk/plugins/json.js
r1987789 r1990067 5 5 compile: (compiler) => { 6 6 const lino = compiler.getLino(); 7 compiler.next(); 8 const request = compiler.getToken(); 7 const request = compiler.nextToken(); 9 8 switch (request) { 10 9 case 'get': 11 10 compiler.next(); 12 11 if (compiler.tokenIs('property')) { 13 compiler.next(); 14 const item = compiler.getValue(); 12 const item = compiler.getNextValue(); 15 13 if (compiler.tokenIs('of')) { 16 compiler.next(); 17 if (compiler.isSymbol()) { 14 if (compiler.nextIsSymbol()) { 18 15 const source = compiler.getToken(); 19 compiler.next(); 20 if (compiler.tokenIs("as")) { 21 compiler.next(); 22 if (compiler.isSymbol()) { 16 if (compiler.nextTokenIs("as")) { 17 if (compiler.nextIsSymbol()) { 23 18 const targetRecord = compiler.getSymbolRecord(); 24 19 if (targetRecord.keyword === 'variable') { … … 41 36 throw new Error(`Expected '${'of'}' but saw '${compiler.getToken()}`); 42 37 } else if (compiler.tokenIs('element')) { 43 compiler.next(); 44 const element = compiler.getValue(); 38 const element = compiler.getNextValue(); 45 39 if (compiler.tokenIs('of')) { 46 compiler.next(); 47 if (compiler.isSymbol()) { 40 if (compiler.nextIsSymbol()) { 48 41 const source = compiler.getToken(); 49 compiler.next(); 50 if (compiler.tokenIs("as")) { 51 compiler.next(); 52 if (compiler.isSymbol()) { 42 if (compiler.nextTokenIs("as")) { 43 if (compiler.nextIsSymbol()) { 53 44 const targetRecord = compiler.getSymbolRecord(); 54 45 if (targetRecord.keyword === 'variable') { … … 75 66 compiler.next(); 76 67 if (compiler.tokenIs('property')) { 77 compiler.next(); 78 const name = compiler.getValue(); 68 const name = compiler.getNextValue(); 79 69 if (compiler.tokenIs('of')) { 80 compiler.next(); 81 if (compiler.isSymbol()) { 70 if (compiler.nextIsSymbol()) { 82 71 const targetRecord = compiler.getSymbolRecord(); 83 72 if (targetRecord.keyword === 'variable') { 84 compiler.next(); 85 if (compiler.tokenIs('to')) { 86 compiler.next(); 87 const value = compiler.getValue(); 73 if (compiler.nextTokenIs('to')) { 74 const value = compiler.getNextValue(); 88 75 compiler.addCommand({ 89 76 domain: 'json', … … 105 92 const targetRecord = compiler.getSymbolRecord(); 106 93 if (targetRecord.keyword === 'variable') { 107 compiler.next(); 108 if (compiler.tokenIs('to')) { 109 compiler.next(); 110 const type = compiler.getToken(); 94 if (compiler.nextTokenIs('to')) { 95 const type = compiler.nextToken(); 111 96 if ('["array","object"]'.includes(type)) { 112 97 compiler.next(); … … 123 108 } 124 109 } else if (targetRecord.keyword === 'select') { 125 compiler.next(); 126 if (compiler.tokenIs('from')) { 110 if (compiler.nextTokenIs('from')) { 127 111 compiler.next(); 128 112 if (compiler.isSymbol()) { 129 113 const sourceRecord = compiler.getSymbolRecord(); 130 114 if (sourceRecord.keyword === 'variable') { 131 compiler.next();132 115 var display = null; 133 if (compiler.tokenIs('as')) { 134 compiler.next(); 135 display = compiler.getValue(); 116 if (compiler.nextTokenIs('as')) { 117 display = compiler.getNextValue(); 136 118 } 137 119 compiler.addCommand({ … … 153 135 case 'shuffle': 154 136 case 'format': 155 compiler.next(); 156 if (compiler.isSymbol()) { 137 if (compiler.nextIsSymbol()) { 157 138 const targetRecord = compiler.getSymbolRecord(); 158 139 if (targetRecord.keyword === 'variable') { … … 296 277 compile: (compiler) => { 297 278 const lino = compiler.getLino(); 298 compiler.next(); 299 const request = compiler.getToken(); 279 const request = compiler.nextToken(); 300 280 switch (request) { 301 281 case 'get': 302 compiler.next(); 303 if (compiler.isSymbol()) { 282 if (compiler.nextIsSymbol()) { 304 283 const targetRecord = compiler.getSymbolRecord(); 305 284 if (targetRecord.keyword === 'variable') { 306 compiler.next(); 307 if (compiler.tokenIs('from')) { 285 if (compiler.nextTokenIs('from')) { 308 286 compiler.next(); 309 287 const url = compiler.getValue(); … … 322 300 break; 323 301 case 'post': 324 compiler.next();325 302 var value = null; 326 if (compiler. tokenIs('to')) {303 if (compiler.nextTokenIs('to')) { 327 304 compiler.next(); 328 305 } else { … … 443 420 } 444 421 if (compiler.tokenIs('json')) { 445 compiler.next(); 446 if (['size', 'count'].includes(compiler.getToken())) { 422 if (['size', 'count'].includes(compiler.nextToken())) { 447 423 compiler.skip('of'); 448 424 if (compiler.isSymbol()) { -
easycoder/trunk/plugins/svg.js
r1986782 r1990067 5 5 compile: (compiler) => { 6 6 const lino = compiler.getLino(); 7 compiler.next(); 8 if (compiler.isSymbol()) { 7 if (compiler.nextIsSymbol()) { 9 8 const symbol = compiler.getProgram()[compiler.getSymbol().pc]; 10 9 switch (symbol.keyword) { 11 10 case 'shape': 12 11 case 'svg': 13 compiler.next(); 14 if (compiler.tokenIs('to')) { 15 compiler.next(); 16 const cssId = compiler.getValue(); 12 if (compiler.nextTokenIs('to')) { 13 const cssId = compiler.getNextValue(); 17 14 compiler.addCommand({ 18 15 domain: 'svg', … … 68 65 compile: (compiler) => { 69 66 const lino = compiler.getLino(); 70 compiler.next(); 71 if (compiler.isSymbol()) { 67 if (compiler.nextIsSymbol()) { 72 68 const symbolRecord = compiler.getSymbolRecord(); 73 69 compiler.next(); … … 75 71 case 'svg': 76 72 if (compiler.tokenIs('in')) { 77 compiler.next(); 78 if (compiler.isSymbol()) { 73 if (compiler.nextIsSymbol()) { 79 74 const parent = compiler.getToken(); 80 75 compiler.next(); … … 116 111 case 'group': 117 112 if (compiler.tokenIs('in')) { 118 compiler.next(); 119 if (compiler.isSymbol()) { 113 if (compiler.nextIsSymbol()) { 120 114 const parentRecord = compiler.getSymbolRecord(); 121 115 if (!['svg', 'group'].includes(parentRecord.keyword)) { … … 141 135 case 'text': 142 136 if (compiler.tokenIs('in')) { 143 compiler.next(); 144 if (compiler.isSymbol()) { 137 if (compiler.nextIsSymbol()) { 145 138 const parentRecord = compiler.getSymbolRecord(); 146 139 if (!['svg', 'group'].includes(parentRecord.keyword)) { … … 301 294 compile: (compiler) => { 302 295 const lino = compiler.getLino(); 303 compiler.next(); 304 if (compiler.isSymbol()) { 296 if (compiler.nextIsSymbol()) { 305 297 const symbolRecord = compiler.getSymbolRecord(); 306 compiler.next(); 307 if (compiler.tokenIs('to')) { 308 compiler.next(); 309 const x = compiler.getValue(); 298 if (compiler.nextTokenIs('to')) { 299 const x = compiler.getNextValue(); 310 300 const y = compiler.getValue(); 311 301 compiler.addCommand({ … … 406 396 compile: (compiler) => { 407 397 const lino = compiler.getLino(); 408 compiler.next(); 409 const action = compiler.getToken(); 398 const action = compiler.nextToken(); 410 399 switch (action) { 411 400 case 'click': 412 compiler.next(); 413 if (compiler.isSymbol()) { 401 if (compiler.nextIsSymbol()) { 414 402 const symbol = compiler.getSymbolRecord(); 415 403 compiler.next(); … … 510 498 compile: (compiler) => { 511 499 const lino = compiler.getLino(); 512 compiler.next(); 513 var token = compiler.getToken(); 500 var token = compiler.nextToken(); 514 501 if (token === 'the') { 515 compiler.next(); 516 token = compiler.getToken(); 502 token = compiler.nextToken(); 517 503 } 518 504 if (token === 'text') { 519 compiler.next(); 520 if (compiler.tokenIs('of')) { 521 compiler.next(); 522 if (compiler.isSymbol()) { 505 if (compiler.nextTokenIs('of')) { 506 if (compiler.nextIsSymbol()) { 523 507 const symbol = compiler.getSymbolRecord(); 524 508 switch (symbol.keyword) { 525 509 case 'text': 526 compiler.next(); 527 if (compiler.tokenIs('to')) { 510 if (compiler.nextTokenIs('to')) { 528 511 compiler.next(); 529 512 const value = compiler.getValue(); … … 648 631 } 649 632 if (compiler.tokenIs('text')) { 650 compiler.next(); 651 if (compiler.tokenIs('of')) { 652 compiler.next(); 653 if (compiler.isSymbol()) { 633 if (compiler.nextTokenIs('of')) { 634 if (compiler.nextIsSymbol()) { 654 635 const symbolRecord = compiler.getSymbolRecord(); 655 636 compiler.next(); -
easycoder/trunk/readme.txt
r1987906 r1990067 50 50 51 51 == Changelog == 52 53 = 2.1.7 09-dec-2018 = 54 * Moved local files out of plugins folder. 52 55 53 56 = 2.1.6 07-dec-2018 = -
easycoder/trunk/rest.php
r1987789 r1990067 133 133 } 134 134 135 include ' rest-local.php';135 include '../../../easycoder/rest-local.php'; 136 136 switch ($method) { 137 137
Note: See TracChangeset
for help on using the changeset viewer.