Browse Source

Runn prettier

master
Dylan Baker 5 years ago
parent
commit
802884b135
2 changed files with 6 additions and 3 deletions
  1. 0
    1
      src/compiler.js
  2. 6
    2
      src/parser.js

+ 0
- 1
src/compiler.js View File

47
         if (!selfClosingTags.includes(node.functionName)) {
47
         if (!selfClosingTags.includes(node.functionName)) {
48
           this.result += `</${node.functionName}>`
48
           this.result += `</${node.functionName}>`
49
         }
49
         }
50
-
51
       } else if (node.type === 'string') {
50
       } else if (node.type === 'string') {
52
         this.result += node.content
51
         this.result += node.content
53
       } else if (node.type === 'identifier') {
52
       } else if (node.type === 'identifier') {

+ 6
- 2
src/parser.js View File

40
       type: 'functionCall',
40
       type: 'functionCall',
41
       args: [],
41
       args: [],
42
       subtree: [],
42
       subtree: [],
43
-      functionName: this.tokenStream.eat(tokenTypes.LITERAL).value
43
+      functionName: this.tokenStream.eat(tokenTypes.LITERAL).value,
44
     })
44
     })
45
 
45
 
46
-    while (![tokenTypes.CPAREN, tokenTypes.EOF].includes(this.tokenStream.peek().type)) {
46
+    while (
47
+      ![tokenTypes.CPAREN, tokenTypes.EOF].includes(
48
+        this.tokenStream.peek().type,
49
+      )
50
+    ) {
47
       if (this.tokenStream.peek().type === tokenTypes.ATTRIBUTE) {
51
       if (this.tokenStream.peek().type === tokenTypes.ATTRIBUTE) {
48
         elementNode.args.push(this.attribute())
52
         elementNode.args.push(this.attribute())
49
       } else if (this.tokenStream.peek().type === tokenTypes.QUOTE) {
53
       } else if (this.tokenStream.peek().type === tokenTypes.QUOTE) {

Loading…
Cancel
Save