1
0
Fork 0

Go fmt em all

This commit is contained in:
Gregory Eremin 2014-10-20 22:27:40 +07:00
parent 81068376fa
commit 3c14e17cb1
12 changed files with 1625 additions and 1799 deletions

View File

@ -1,4 +1,3 @@
package errors
import (

View File

@ -1,4 +1,3 @@
package lexer
import (
@ -310,5 +309,4 @@ var ActTab = ActionTable{
Accept: 22,
Ignore: "",
},
}

View File

@ -1,4 +1,3 @@
package lexer
import (
@ -6,9 +5,9 @@ import (
// "fmt"
// "github.com/localhots/penny/util"
"github.com/localhots/penny/token"
"io/ioutil"
"unicode/utf8"
"github.com/localhots/penny/token"
)
const (
@ -77,7 +76,6 @@ func (this *Lexer) Scan() (tok *token.Token) {
this.column++
}
// Production start
if rune1 != -1 {
state = TransTab[state](rune1)
@ -99,7 +97,6 @@ func (this *Lexer) Scan() (tok *token.Token) {
// state = nextState
// Debug end
if state != -1 {
switch {
case ActTab[state].Accept != -1:

View File

@ -1,8 +1,5 @@
package lexer
/*
Let s be the current state
Let r be the current input rune
@ -78,7 +75,6 @@ var TransTab = TransitionTable{
case r == 125: // ['}','}']
return 24
default:
return 25
}
@ -89,8 +85,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -100,8 +94,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -113,8 +105,6 @@ var TransTab = TransitionTable{
case r == 38: // ['&','&']
return 26
}
return NoState
@ -124,8 +114,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -135,8 +123,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -148,8 +134,6 @@ var TransTab = TransitionTable{
case 48 <= r && r <= 57: // ['0','9']
return 6
}
return NoState
@ -161,8 +145,6 @@ var TransTab = TransitionTable{
case r == 59: // [';',';']
return 27
}
return NoState
@ -178,8 +160,6 @@ var TransTab = TransitionTable{
case r == 62: // ['>','>']
return 30
}
return NoState
@ -189,8 +169,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -206,8 +184,6 @@ var TransTab = TransitionTable{
case r == 124: // ['|','|']
return 33
}
return NoState
@ -219,8 +195,6 @@ var TransTab = TransitionTable{
case r == 110: // ['n','n']
return 34
}
return NoState
@ -236,8 +210,6 @@ var TransTab = TransitionTable{
case 97 <= r && r <= 122: // ['a','z']
return 36
}
return NoState
@ -249,8 +221,6 @@ var TransTab = TransitionTable{
case 65 <= r && r <= 90: // ['A','Z']
return 37
}
return NoState
@ -264,8 +234,6 @@ var TransTab = TransitionTable{
case r == 97: // ['a','a']
return 38
}
return NoState
@ -279,8 +247,6 @@ var TransTab = TransitionTable{
case r == 111: // ['o','o']
return 39
}
return NoState
@ -296,8 +262,6 @@ var TransTab = TransitionTable{
case r == 115: // ['s','s']
return 41
}
return NoState
@ -313,8 +277,6 @@ var TransTab = TransitionTable{
case r == 111: // ['o','o']
return 43
}
return NoState
@ -330,8 +292,6 @@ var TransTab = TransitionTable{
case r == 110: // ['n','n']
return 45
}
return NoState
@ -345,8 +305,6 @@ var TransTab = TransitionTable{
case r == 104: // ['h','h']
return 46
}
return NoState
@ -360,8 +318,6 @@ var TransTab = TransitionTable{
case r == 110: // ['n','n']
return 47
}
return NoState
@ -375,8 +331,6 @@ var TransTab = TransitionTable{
case r == 104: // ['h','h']
return 48
}
return NoState
@ -386,8 +340,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -399,8 +351,6 @@ var TransTab = TransitionTable{
case r == 124: // ['|','|']
return 49
}
return NoState
@ -410,8 +360,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -421,8 +369,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -432,8 +378,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -443,8 +387,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -454,8 +396,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -467,8 +407,6 @@ var TransTab = TransitionTable{
case r == 45: // ['-','-']
return 50
}
return NoState
@ -478,8 +416,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -489,8 +425,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -500,8 +434,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -511,8 +443,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -522,8 +452,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -539,8 +467,6 @@ var TransTab = TransitionTable{
case 97 <= r && r <= 122: // ['a','z']
return 36
}
return NoState
@ -552,8 +478,6 @@ var TransTab = TransitionTable{
case 65 <= r && r <= 90: // ['A','Z']
return 51
}
return NoState
@ -569,8 +493,6 @@ var TransTab = TransitionTable{
case 97 <= r && r <= 122: // ['a','z']
return 53
}
return NoState
@ -582,8 +504,6 @@ var TransTab = TransitionTable{
case r == 115: // ['s','s']
return 54
}
return NoState
@ -595,8 +515,6 @@ var TransTab = TransitionTable{
case r == 110: // ['n','n']
return 55
}
return NoState
@ -610,8 +528,6 @@ var TransTab = TransitionTable{
case r == 115: // ['s','s']
return 57
}
return NoState
@ -623,8 +539,6 @@ var TransTab = TransitionTable{
case r == 97: // ['a','a']
return 58
}
return NoState
@ -634,8 +548,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -647,8 +559,6 @@ var TransTab = TransitionTable{
case r == 114: // ['r','r']
return 59
}
return NoState
@ -658,8 +568,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -669,8 +577,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -682,8 +588,6 @@ var TransTab = TransitionTable{
case r == 101: // ['e','e']
return 60
}
return NoState
@ -695,8 +599,6 @@ var TransTab = TransitionTable{
case r == 116: // ['t','t']
return 61
}
return NoState
@ -708,8 +610,6 @@ var TransTab = TransitionTable{
case r == 105: // ['i','i']
return 62
}
return NoState
@ -719,8 +619,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -730,8 +628,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -747,8 +643,6 @@ var TransTab = TransitionTable{
case 97 <= r && r <= 122: // ['a','z']
return 36
}
return NoState
@ -764,8 +658,6 @@ var TransTab = TransitionTable{
case 97 <= r && r <= 122: // ['a','z']
return 53
}
return NoState
@ -777,8 +669,6 @@ var TransTab = TransitionTable{
case 65 <= r && r <= 90: // ['A','Z']
return 37
}
return NoState
@ -790,8 +680,6 @@ var TransTab = TransitionTable{
case r == 101: // ['e','e']
return 63
}
return NoState
@ -803,8 +691,6 @@ var TransTab = TransitionTable{
case r == 101: // ['e','e']
return 64
}
return NoState
@ -816,8 +702,6 @@ var TransTab = TransitionTable{
case r == 102: // ['f','f']
return 65
}
return NoState
@ -829,8 +713,6 @@ var TransTab = TransitionTable{
case r == 101: // ['e','e']
return 66
}
return NoState
@ -842,8 +724,6 @@ var TransTab = TransitionTable{
case r == 99: // ['c','c']
return 67
}
return NoState
@ -853,8 +733,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -866,8 +744,6 @@ var TransTab = TransitionTable{
case r == 110: // ['n','n']
return 68
}
return NoState
@ -879,8 +755,6 @@ var TransTab = TransitionTable{
case r == 105: // ['i','i']
return 69
}
return NoState
@ -892,8 +766,6 @@ var TransTab = TransitionTable{
case r == 108: // ['l','l']
return 70
}
return NoState
@ -903,8 +775,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -914,8 +784,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -925,8 +793,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -936,8 +802,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -947,8 +811,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -958,8 +820,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -971,8 +831,6 @@ var TransTab = TransitionTable{
case r == 108: // ['l','l']
return 71
}
return NoState
@ -984,8 +842,6 @@ var TransTab = TransitionTable{
case r == 101: // ['e','e']
return 72
}
return NoState
@ -995,8 +851,6 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
@ -1006,11 +860,8 @@ var TransTab = TransitionTable{
func(r rune) int {
switch {
}
return NoState
},
}

View File

@ -1,4 +1,3 @@
package parser
import (

View File

@ -1,4 +1,3 @@
package parser
type (
@ -56,7 +55,6 @@ var actionTab = actionTable{
nil, /* ; */
},
},
actionRow{ // S1
canRecover: false,
@ -104,7 +102,6 @@ var actionTab = actionTable{
nil, /* ; */
},
},
actionRow{ // S2
canRecover: false,
@ -152,8 +149,5 @@ var actionTab = actionTable{
nil, /* ; */
},
},
}

View File

@ -1,9 +1,9 @@
/*
*/
package parser
const numNTSymbols = 47
type (
gotoTable [numStates]gotoRow
gotoRow [numNTSymbols]int
@ -60,7 +60,6 @@ var gotoTab = gotoTable{
-1, // Separator
-1, // SequentialSep
},
gotoRow{ // S1
@ -112,7 +111,6 @@ var gotoTab = gotoTable{
-1, // Separator
-1, // SequentialSep
},
gotoRow{ // S2
@ -164,7 +162,5 @@ var gotoTab = gotoTable{
-1, // Separator
-1, // SequentialSep
},
}

View File

@ -1,10 +1,9 @@
package parser
import (
"bytes"
"fmt"
"errors"
"fmt"
parseError "github.com/localhots/penny/errors"
"github.com/localhots/penny/token"
)
@ -190,7 +189,6 @@ func (this *Parser) Parse(scanner Scanner) (res interface{}, err error) {
// fmt.Printf("S%d %s %s\n", this.stack.top(), token.TokMap.TokenString(this.nextToken), action.String())
switch act := action.(type) {
case accept:
res = this.stack.popN(1)[0]

View File

@ -1,4 +1,3 @@
package parser
import "github.com/localhots/penny/ast"
@ -1099,5 +1098,4 @@ var productionsTable = ProdTab {
return X[0], nil
},
},
}

View File

@ -1,4 +1,3 @@
package token
import (
@ -145,4 +144,3 @@ var TokMap = TokenMap{
";": 40,
},
}

View File

@ -1,4 +1,3 @@
//Copyright 2013 Vastech SA (PTY) LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");

View File

@ -1,4 +1,3 @@
//Copyright 2013 Vastech SA (PTY) LTD
//
// Licensed under the Apache License, Version 2.0 (the "License");