diff --git a/static/css/main.css b/static/css/main.css index 0e920b8..bb2bbc2 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -178,7 +178,6 @@ textarea.editor-input { textarea.editor-input:focus { outline: none; - background: #f8f8f8; } .filler p { @@ -227,4 +226,7 @@ footer a { textarea.editor-input { font-size: .8em; } + .desktop { + display: none; + } } diff --git a/static/js/lang.js b/static/js/lang.js index a69a843..6ecc102 100644 --- a/static/js/lang.js +++ b/static/js/lang.js @@ -103,7 +103,7 @@ const T = { DiscoverHowTo: Symbol('DiscoverHowTo'), With: Symbol('With'), Of: Symbol('Of'), - WeSaid: Symbol('WeSaid'), + RumorHasIt: Symbol('RumorHasIt'), WhatIf: Symbol('WhatIf'), LiesBang: Symbol('LiesBang'), EndOfStory: Symbol('EndOfStory'), @@ -160,9 +160,10 @@ function tokenize(prog) { tokens.push(T.Of); break; } - case 'WE': { - reader.expect('SAID'); - tokens.push(T.WeSaid); + case 'RUMOR': { + reader.expect('HAS'); + reader.expect('IT'); + tokens.push(T.RumorHasIt); break; } case 'WHAT': { @@ -409,7 +410,7 @@ class Parser { body: this.expr(), } } - } else if (next === T.WeSaid) { + } else if (next === T.RumorHasIt) { // block const exprs = []; while (this.tokens.hasNext() && this.tokens.peek() !== T.EndOfStory) { diff --git a/static/js/main.js b/static/js/main.js index debad58..fe242d8 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -1,7 +1,7 @@ const PROG_FACTORIAL = `YOU WON'T WANT TO MISS 'Hello, World!' DISCOVER HOW TO factorial WITH n -WE SAID +RUMOR HAS IT WHAT IF n IS ACTUALLY 0 SHOCKING DEVELOPMENT 1 LIES! @@ -16,10 +16,10 @@ YOU WON'T WANT TO MISS result PLEASE LIKE AND SUBSCRIBE`; const PROG_FIBONACCI = `DISCOVER HOW TO fibonacci WITH a, b, n -WE SAID +RUMOR HAS IT WHAT IF n SMALLER THAN 1 SHOCKING DEVELOPMENT b - LIES! WE SAID + LIES! RUMOR HAS IT YOU WON'T WANT TO MISS b SHOCKING DEVELOPMENT fibonacci OF b, a PLUS b, n MINUS 1 @@ -109,11 +109,11 @@ class Editor extends Component { return jdom`
+ onclick=${this.setFibonacci}>Fibonacci sample + onclick=${this.setFactorial}>Factorial sample + onclick=${this.handleRun}>Run this!
@@ -231,10 +231,10 @@ class App extends Component { target="_blank">Ink.

How much is there?

-

Here's the full list of non-standard keywords that Tabloid currently uses:

+

Here's the full list of standard keywords that Tabloid currently uses:

  • DISCOVER HOW TO...WITH declare a function
  • -
  • WE SAID begin a block scope
  • +
  • RUMOR HAS IT begin a block scope
  • A OF B, C call function A with arguments B, C
  • WHAT IF...LIES! an if-else expression
  • END OF STORY end a block scope
  • @@ -243,6 +243,7 @@ class App extends Component {
  • TOTALLY RIGHT true
  • COMPLETELY WRONG false
  • PLUS / MINUS / TIMES / DIVIDED BY / MODULO the obvious arithmetic operations
  • +
  • BEATS / SMALLER THAN greater than / less than
  • IS ACTUALLY is equal to
  • BEATS / SMALLER THAN greater than / less than
  • SHOCKING DEVELOPMENT return from a function