Plugin Directory

Changeset 1990067


Ignore:
Timestamp:
12/09/2018 05:41:36 PM (7 years ago)
Author:
gtanyware
Message:

Version 2.1.7; moved local files to top level foder

Location:
easycoder/trunk
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • easycoder/trunk/easycoder-min.js

    r1987906 r1990067  
    1818a.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=
    1919[];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",
     20c);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",
    2121keyword:"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",
    2222numeric:!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=
     
    7575this.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 "+
    7676(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?"),
     77addGlobalPlugin: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");
     78c.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=
     79l},{"./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?"),
    8080b);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);
    8181if(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  
    343343    compile: compiler => {
    344344      const lino = compiler.getLino();
     345      compiler.next();
    345346      // Get the (first) value
    346       const value1 = compiler.getNextValue();
     347      const value1 = compiler.getValue();
    347348      if (compiler.tokenIs('to')) {
    348349        compiler.next();
     
    28272828
    28282829  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`;
    28302831    const ajax = new XMLHttpRequest();
    28312832    ajax.open('GET', fullPath, true);
     
    28352836          case 200:
    28362837            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`;
    28382839            script.type = 'text/javascript';
    28392840            script.onload = function () {
     
    30053006                EasyCoder_Run(program, program.resume);
    30063007              } catch (err) {
    3007                 const message = `Error in step handler: ${err.message}`;
     3008                const message = 'Error in step handler: ' + err.message;
    30083009                console.log(message);
    30093010                alert(message);
  • easycoder/trunk/easycoder.php

    r1987798 r1990067  
    44  * Plugin URI: https://easycoder.software
    55  * 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.6
     6  * Version: 2.1.7
    77  * Author: EasyCoder Software
    88  * Author URI: https://easycoder.software
     
    1717  function easycoder_enqueue_script() {   
    1818    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');
    2020  }
    2121 
     
    2424  function setup_default_files() {
    2525    $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');
    2830    }
    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');
    3133    }
    3234  }
  • easycoder/trunk/plugins/browser.js

    r1986782 r1990067  
    1717    compile: (compiler) => {
    1818      const lino = compiler.getLino();
    19       compiler.next();
    20       const value = compiler.getValue();
     19      const value = compiler.getNextValue();
    2120      compiler.addCommand({
    2221        domain: 'browser',
     
    3231      const value = program.getValue(command.value);
    3332      alert(value);
    34       return program[program.pc].pc + 1;
     33      return command.pc + 1;
    3534    }
    3635  },
     
    6261            compiler.next();
    6362            if (compiler.tokenIs('to')) {
    64               compiler.next();
    65               const cssId = compiler.getValue();
     63              const cssId = compiler.getNextValue();
    6664              compiler.addCommand({
    6765                domain: 'browser',
     
    144142    compile: (compiler) => {
    145143      const lino = compiler.getLino();
    146       compiler.next();
    147       if (compiler.isSymbol()) {
     144      if (compiler.nextIsSymbol()) {
    148145        const symbolRecord = compiler.getSymbolRecord();
    149146        const target = symbolRecord.name;
     
    277274          break;
    278275      }
    279       return program[program.pc].pc + 1;
     276      return command.pc + 1;
    280277    }
    281278  },
     
    285282    compile: (compiler) => {
    286283      const lino = compiler.getLino();
    287       compiler.next();
    288       if (compiler.isSymbol()) {
     284      if (compiler.nextIsSymbol()) {
    289285        const symbol = compiler.getToken();
    290286        compiler.next();
     
    326322    compile: (compiler) => {
    327323      const lino = compiler.getLino();
    328       compiler.next();
    329       if (compiler.isSymbol()) {
     324      if (compiler.nextIsSymbol()) {
    330325        const symbol = compiler.getToken();
    331326        compiler.next();
     
    489484    compile: (compiler) => {
    490485      const lino = compiler.getLino();
    491       compiler.next();
    492486      var newWindow = false;
    493       if (compiler.tokenIs('new')) {
     487      if (compiler.nextTokenIs('new')) {
    494488        newWindow = true;
    495489        compiler.next();
     
    521515    compile: (compiler) => {
    522516      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();
    527519        var subject = '';
    528520        var body = '';
    529521        if (compiler.tokenIs('subject')) {
    530           compiler.next();
    531           subject = compiler.getValue();
     522          subject = compiler.getNextValue();
    532523          if (compiler.tokenIs('body') || compiler.tokenIs('message')) {
    533524            compiler.next();
     
    564555    compile: (compiler) => {
    565556      const lino = compiler.getLino();
    566       compiler.next();
    567       const action = compiler.getToken();
     557      const action = compiler.nextToken();
    568558      switch (action) {
    569559        case 'change':
    570560        case 'click':
    571           compiler.next();
    572           if (compiler.isSymbol()) {
     561          if (compiler.nextIsSymbol()) {
    573562            const symbol = compiler.getSymbolRecord();
    574563            compiler.next();
     
    718707    compile: (compiler) => {
    719708      const lino = compiler.getLino();
    720       compiler.next();
    721       if (compiler.isSymbol()) {
     709      if (compiler.nextIsSymbol()) {
    722710        const targetRecord = compiler.getSymbolRecord();
    723711        if (targetRecord.keyword === 'audioclip') {
     
    740728      const url = program.value.evaluate(program, targetRecord.value[targetRecord.index]).content;
    741729      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) => {
    742742      return program[program.pc].pc + 1;
    743743    }
    744744  },
    745745
    746   Popup: {
    747 
    748     compile: (compiler) => {
    749       const item = compiler.compileVariable('browser', 'popup');
     746  PRE: {
     747
     748    compile: (compiler) => {
     749      const item = compiler.compileVariable('browser', 'pre', false, 'dom');
    750750      return true;
    751751    },
     
    756756  },
    757757
    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 
    770758  Prompt: {
    771759
    772760    compile: (compiler) => {
    773761      const lino = compiler.getLino();
    774       compiler.next();
    775       const text = compiler.getValue();
     762      const text = compiler.getNextValue();
    776763      if (compiler.tokenIs('with')) {
    777         compiler.next();
    778         const pre = compiler.getValue();
     764        const pre = compiler.getNextValue();
    779765        compiler.addCommand({
    780766          domain: 'browser',
     
    801787    compile: (compiler) => {
    802788      const lino = compiler.getLino();
    803       compiler.next();
    804789      // Get the value
    805       const value = compiler.getValue();
     790      const value = compiler.getNextValue();
    806791      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();
    813795            compiler.addCommand({
    814796              domain: 'browser',
     
    850832    compile: (compiler) => {
    851833      const lino = compiler.getLino();
    852       compiler.next();
    853       if (compiler.isSymbol()) {
     834      if (compiler.nextIsSymbol()) {
    854835        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()) {
    859838            const source = compiler.getToken();
    860839            compiler.next();
     
    873852        var token = compiler.getToken();
    874853        if (token === 'the') {
    875           compiler.next();
    876           token = compiler.getToken();
     854          token = compiler.nextToken();
    877855        }
    878856        if (token === 'title') {
     
    888866          return true;
    889867        } else if (token === 'content') {
    890           compiler.next();
    891           if (compiler.tokenIs('of')) {
     868          if (compiler.nextTokenIs('of')) {
    892869            compiler.next();
    893870            if (compiler.isSymbol()) {
    894871              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()) {
    899874                  const source = compiler.getToken();
    900875                  compiler.next();
     
    911886              }
    912887              if (compiler.tokenIs('to')) {
    913                 compiler.next();
    914                 const value = compiler.getValue();
     888                const value = compiler.getNextValue();
    915889                compiler.addCommand({
    916890                  domain: 'browser',
     
    927901          }
    928902        } else if (token === 'text') {
    929           compiler.next();
    930           if (compiler.tokenIs('of')) {
     903          if (compiler.nextTokenIs('of')) {
    931904            compiler.next();
    932905            if (compiler.isSymbol()) {
     
    935908                case 'button':
    936909                case 'input':
    937                   compiler.next();
    938                   if (compiler.tokenIs('to')) {
     910                  if (compiler.nextTokenIs('to')) {
    939911                    compiler.next();
    940912                    const value = compiler.getValue();
     
    956928          }
    957929        } else if (token === 'size') {
    958           compiler.next();
    959           if (compiler.tokenIs('of')) {
     930          if (compiler.nextTokenIs('of')) {
    960931            compiler.next();
    961932            if (compiler.isSymbol()) {
     
    965936                  compiler.next();
    966937                  if (compiler.tokenIs('to')) {
    967                     compiler.next();
    968                     const value = compiler.getValue();
     938                    const value = compiler.getNextValue();
    969939                    compiler.addCommand({
    970940                      domain: 'browser',
     
    984954          const attributeName = compiler.getValue();
    985955          if (compiler.tokenIs('of')) {
    986             compiler.next();
    987             if (compiler.isSymbol()) {
     956            if (compiler.nextIsSymbol()) {
    988957              const symbolName = compiler.getToken();
    989958              compiler.next();
     
    993962              };
    994963              if (compiler.tokenIs('to')) {
    995                 compiler.next();
    996                 attributeValue = compiler.getValue();
     964                attributeValue = compiler.getNextValue();
    997965              }
    998966              compiler.addCommand({
     
    1009977          }
    1010978        } else if (token === 'style') {
    1011           compiler.next();
    1012           const styleName = compiler.getValue();
     979          const styleName = compiler.getNextValue();
    1013980          var type = 'setStyle';
    1014981          var symbolName = '';
    1015982          if (compiler.tokenIs('of')) {
    1016             compiler.next();
    1017             if (compiler.getToken() === 'body') {
     983
     984            if (compiler.nextToken() === 'body') {
    1018985              type = 'setBodyStyle';
    1019986            } else if (compiler.isSymbol()) {
     
    1024991            compiler.next();
    1025992            if (compiler.tokenIs('to')) {
    1026               compiler.next();
    1027               const styleValue = compiler.getValue();
     993              const styleValue = compiler.getNextValue();
    1028994              if (styleValue) {
    1029995                compiler.addCommand({
     
    11901156    compile: (compiler) => {
    11911157      const lino = compiler.getLino();
    1192       compiler.next();
    11931158      const variables = [];
    1194       if (compiler.isSymbol()) {
     1159      if (compiler.nextIsSymbol()) {
    11951160        while (compiler.isSymbol()) {
    11961161          variables.push(compiler.getToken());
     
    12631228    compile: (compiler) => {
    12641229      const lino = compiler.getLino();
    1265       compiler.next();
    1266       const file = compiler.getValue();
     1230      const file = compiler.getNextValue();
    12671231      if (compiler.tokenIs('to')) {
    1268         compiler.next();
    1269         const path = compiler.getValue();
     1232        const path = compiler.getNextValue();
    12701233        if (compiler.tokenIs('with')) {
    1271           compiler.next();
    1272           const progress = compiler.getValue();
     1234          const progress = compiler.getNextValue();
    12731235          if (compiler.tokenIs('and')) {
    1274             compiler.next();
    1275             const status = compiler.getValue();
     1236            const status = compiler.getNextValue();
    12761237            compiler.addCommand({
    12771238              domain: 'browser',
  • easycoder/trunk/plugins/ckeditor.js

    r1986782 r1990067  
    55    compile: (compiler) => {
    66      const lino = compiler.getLino();
    7       compiler.next();
    8       const action = compiler.getToken();
     7      const action = compiler.nextToken();
    98      compiler.next();
    109      switch (action) {
    1110        case 'append':
    1211          if (compiler.tokenIs('to')) {
    13             compiler.next();
    14             if (compiler.isSymbol()) {
     12            if (compiler.nextIsSymbol()) {
    1513              const appendVar = compiler.getToken();
    1614              compiler.next();
     
    4341          if (compiler.isSymbol()) {
    4442            const target = compiler.getToken();
    45             compiler.next();
    46             if (compiler.tokenIs('from')) {
     43            if (compiler.nextTokenIs('from')) {
    4744              compiler.next();
    4845              if (compiler.isSymbol()) {
     
    6562          if (compiler.isSymbol()) {
    6663            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();
    7166                compiler.addCommand({
    7267                domain: 'ckeditor',
  • easycoder/trunk/plugins/json.js

    r1987789 r1990067  
    55    compile: (compiler) => {
    66      const lino = compiler.getLino();
    7       compiler.next();
    8       const request = compiler.getToken();
     7      const request = compiler.nextToken();
    98      switch (request) {
    109        case 'get':
    1110          compiler.next();
    1211          if (compiler.tokenIs('property')) {
    13             compiler.next();
    14             const item = compiler.getValue();
     12            const item = compiler.getNextValue();
    1513            if (compiler.tokenIs('of')) {
    16               compiler.next();
    17               if (compiler.isSymbol()) {
     14              if (compiler.nextIsSymbol()) {
    1815                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()) {
    2318                    const targetRecord = compiler.getSymbolRecord();
    2419                    if (targetRecord.keyword === 'variable') {
     
    4136            throw new Error(`Expected '${'of'}' but saw '${compiler.getToken()}`);
    4237          } else if (compiler.tokenIs('element')) {
    43             compiler.next();
    44             const element = compiler.getValue();
     38            const element = compiler.getNextValue();
    4539            if (compiler.tokenIs('of')) {
    46               compiler.next();
    47               if (compiler.isSymbol()) {
     40              if (compiler.nextIsSymbol()) {
    4841                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()) {
    5344                    const targetRecord = compiler.getSymbolRecord();
    5445                    if (targetRecord.keyword === 'variable') {
     
    7566          compiler.next();
    7667          if (compiler.tokenIs('property')) {
    77             compiler.next();
    78             const name = compiler.getValue();
     68            const name = compiler.getNextValue();
    7969            if (compiler.tokenIs('of')) {
    80               compiler.next();
    81               if (compiler.isSymbol()) {
     70              if (compiler.nextIsSymbol()) {
    8271                const targetRecord = compiler.getSymbolRecord();
    8372                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();
    8875                    compiler.addCommand({
    8976                        domain: 'json',
     
    10592            const targetRecord = compiler.getSymbolRecord();
    10693            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();
    11196                if ('["array","object"]'.includes(type)) {
    11297                  compiler.next();
     
    123108              }
    124109            } else if (targetRecord.keyword === 'select') {
    125               compiler.next();
    126               if (compiler.tokenIs('from')) {
     110              if (compiler.nextTokenIs('from')) {
    127111                compiler.next();
    128112                if (compiler.isSymbol()) {
    129113                  const sourceRecord = compiler.getSymbolRecord();
    130114                  if (sourceRecord.keyword === 'variable') {
    131                     compiler.next();
    132115                    var display = null;
    133                     if (compiler.tokenIs('as')) {
    134                       compiler.next();
    135                       display = compiler.getValue();
     116                    if (compiler.nextTokenIs('as')) {
     117                      display = compiler.getNextValue();
    136118                    }
    137119                    compiler.addCommand({
     
    153135        case 'shuffle':
    154136        case 'format':
    155           compiler.next();
    156           if (compiler.isSymbol()) {
     137          if (compiler.nextIsSymbol()) {
    157138            const targetRecord = compiler.getSymbolRecord();
    158139            if (targetRecord.keyword === 'variable') {
     
    296277    compile: (compiler) => {
    297278      const lino = compiler.getLino();
    298       compiler.next();
    299       const request = compiler.getToken();
     279      const request = compiler.nextToken();
    300280      switch (request) {
    301281        case 'get':
    302           compiler.next();
    303           if (compiler.isSymbol()) {
     282          if (compiler.nextIsSymbol()) {
    304283            const targetRecord = compiler.getSymbolRecord();
    305284            if (targetRecord.keyword === 'variable') {
    306               compiler.next();
    307               if (compiler.tokenIs('from')) {
     285              if (compiler.nextTokenIs('from')) {
    308286                compiler.next();
    309287                const url = compiler.getValue();
     
    322300          break;
    323301        case 'post':
    324           compiler.next();
    325302          var value = null;
    326           if (compiler.tokenIs('to')) {
     303          if (compiler.nextTokenIs('to')) {
    327304            compiler.next();
    328305          } else {
     
    443420      }
    444421      if (compiler.tokenIs('json')) {
    445         compiler.next();
    446         if (['size', 'count'].includes(compiler.getToken())) {
     422        if (['size', 'count'].includes(compiler.nextToken())) {
    447423          compiler.skip('of');
    448424          if (compiler.isSymbol()) {
  • easycoder/trunk/plugins/svg.js

    r1986782 r1990067  
    55    compile: (compiler) => {
    66      const lino = compiler.getLino();
    7       compiler.next();
    8       if (compiler.isSymbol()) {
     7      if (compiler.nextIsSymbol()) {
    98        const symbol = compiler.getProgram()[compiler.getSymbol().pc];
    109        switch (symbol.keyword) {
    1110          case 'shape':
    1211          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();
    1714              compiler.addCommand({
    1815                domain: 'svg',
     
    6865    compile: (compiler) => {
    6966      const lino = compiler.getLino();
    70       compiler.next();
    71       if (compiler.isSymbol()) {
     67      if (compiler.nextIsSymbol()) {
    7268        const symbolRecord = compiler.getSymbolRecord();
    7369        compiler.next();
     
    7571          case 'svg':
    7672            if (compiler.tokenIs('in')) {
    77               compiler.next();
    78               if (compiler.isSymbol()) {
     73              if (compiler.nextIsSymbol()) {
    7974                const parent = compiler.getToken();
    8075                compiler.next();
     
    116111          case 'group':
    117112            if (compiler.tokenIs('in')) {
    118               compiler.next();
    119               if (compiler.isSymbol()) {
     113              if (compiler.nextIsSymbol()) {
    120114                const parentRecord = compiler.getSymbolRecord();
    121115                if (!['svg', 'group'].includes(parentRecord.keyword)) {
     
    141135          case 'text':
    142136            if (compiler.tokenIs('in')) {
    143               compiler.next();
    144               if (compiler.isSymbol()) {
     137              if (compiler.nextIsSymbol()) {
    145138                const parentRecord = compiler.getSymbolRecord();
    146139                if (!['svg', 'group'].includes(parentRecord.keyword)) {
     
    301294    compile: (compiler) => {
    302295      const lino = compiler.getLino();
    303       compiler.next();
    304       if (compiler.isSymbol()) {
     296      if (compiler.nextIsSymbol()) {
    305297        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();
    310300          const y = compiler.getValue();
    311301          compiler.addCommand({
     
    406396    compile: (compiler) => {
    407397      const lino = compiler.getLino();
    408       compiler.next();
    409       const action = compiler.getToken();
     398      const action = compiler.nextToken();
    410399      switch (action) {
    411400        case 'click':
    412           compiler.next();
    413           if (compiler.isSymbol()) {
     401          if (compiler.nextIsSymbol()) {
    414402            const symbol = compiler.getSymbolRecord();
    415403            compiler.next();
     
    510498    compile: (compiler) => {
    511499      const lino = compiler.getLino();
    512       compiler.next();
    513       var token = compiler.getToken();
     500      var token = compiler.nextToken();
    514501      if (token === 'the') {
    515         compiler.next();
    516         token = compiler.getToken();
     502        token = compiler.nextToken();
    517503      }
    518504      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()) {
    523507            const symbol = compiler.getSymbolRecord();
    524508            switch (symbol.keyword) {
    525509              case 'text':
    526                 compiler.next();
    527                 if (compiler.tokenIs('to')) {
     510                if (compiler.nextTokenIs('to')) {
    528511                  compiler.next();
    529512                  const value = compiler.getValue();
     
    648631      }
    649632      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()) {
    654635            const symbolRecord = compiler.getSymbolRecord();
    655636            compiler.next();
  • easycoder/trunk/readme.txt

    r1987906 r1990067  
    5050
    5151== Changelog ==
     52
     53= 2.1.7 09-dec-2018 =
     54* Moved local files out of plugins folder.
    5255
    5356= 2.1.6 07-dec-2018 =
  • easycoder/trunk/rest.php

    r1987789 r1990067  
    133133    }
    134134   
    135     include 'rest-local.php';
     135    include '../../../easycoder/rest-local.php';
    136136    switch ($method) {
    137137   
Note: See TracChangeset for help on using the changeset viewer.