Commit 45cba57e authored by Robert Griesemer's avatar Robert Griesemer

gofmt'ed more stragglers

R=rsc
http://go/go-review/1019004
parent 48b31569
...@@ -21,7 +21,7 @@ var shifttests = []shiftTest{ ...@@ -21,7 +21,7 @@ var shifttests = []shiftTest{
shiftTest{1, 100, "1267650600228229401496703205376"}, shiftTest{1, 100, "1267650600228229401496703205376"},
shiftTest{1, -100, shiftTest{1, -100,
"0.00000000000000000000000000000078886090522101180541" "0.00000000000000000000000000000078886090522101180541"
"17285652827862296732064351090230047702789306640625", "17285652827862296732064351090230047702789306640625",
}, },
shiftTest{12345678, 8, "3160493568"}, shiftTest{12345678, 8, "3160493568"},
shiftTest{12345678, -8, "48225.3046875"}, shiftTest{12345678, -8, "48225.3046875"},
......
...@@ -76,7 +76,7 @@ func (c *common) setIndex(i int) { ...@@ -76,7 +76,7 @@ func (c *common) setIndex(i int) {
// The representation of a compiled regular expression. // The representation of a compiled regular expression.
// The public interface is entirely through methods. // The public interface is entirely through methods.
type Regexp struct { type Regexp struct {
expr string; // the original expression expr string; // the original expression
inst []instr; inst []instr;
start instr; start instr;
nbra int; // number of brackets in expression, for subexpressions nbra int; // number of brackets in expression, for subexpressions
...@@ -440,7 +440,7 @@ func (p *parser) term() (start, end instr) { ...@@ -440,7 +440,7 @@ func (p *parser) term() (start, end instr) {
// The other functions (closure(), concatenation() etc.) assume // The other functions (closure(), concatenation() etc.) assume
// it's safe to recur to here. // it's safe to recur to here.
if p.error != "" { if p.error != "" {
return return;
} }
switch c := p.c(); c { switch c := p.c(); c {
case '|', endOfFile: case '|', endOfFile:
...@@ -473,7 +473,7 @@ func (p *parser) term() (start, end instr) { ...@@ -473,7 +473,7 @@ func (p *parser) term() (start, end instr) {
p.nextc(); p.nextc();
start = p.charClass(); start = p.charClass();
if p.error != "" { if p.error != "" {
return return;
} }
if p.c() != ']' { if p.c() != ']' {
p.error = ErrUnmatchedLbkt; p.error = ErrUnmatchedLbkt;
...@@ -580,7 +580,7 @@ func (p *parser) concatenation() (start, end instr) { ...@@ -580,7 +580,7 @@ func (p *parser) concatenation() (start, end instr) {
for { for {
nstart, nend := p.closure(); nstart, nend := p.closure();
if p.error != "" { if p.error != "" {
return return;
} }
switch { switch {
case nstart == nil: // end of this concatenation case nstart == nil: // end of this concatenation
...@@ -602,7 +602,7 @@ func (p *parser) concatenation() (start, end instr) { ...@@ -602,7 +602,7 @@ func (p *parser) concatenation() (start, end instr) {
func (p *parser) regexp() (start, end instr) { func (p *parser) regexp() (start, end instr) {
start, end = p.concatenation(); start, end = p.concatenation();
if p.error != "" { if p.error != "" {
return return;
} }
for { for {
switch p.c() { switch p.c() {
...@@ -612,7 +612,7 @@ func (p *parser) regexp() (start, end instr) { ...@@ -612,7 +612,7 @@ func (p *parser) regexp() (start, end instr) {
p.nextc(); p.nextc();
nstart, nend := p.concatenation(); nstart, nend := p.concatenation();
if p.error != "" { if p.error != "" {
return return;
} }
alt := new(_Alt); alt := new(_Alt);
p.re.add(alt); p.re.add(alt);
...@@ -700,7 +700,7 @@ func addState(s []state, inst instr, match []int) []state { ...@@ -700,7 +700,7 @@ func addState(s []state, inst instr, match []int) []state {
// go in order correctly and this "earlier" test is never necessary, // go in order correctly and this "earlier" test is never necessary,
for i := 0; i < l; i++ { for i := 0; i < l; i++ {
if s[i].inst.index() == index && // same instruction if s[i].inst.index() == index && // same instruction
s[i].match[0] < pos { // earlier match already going; lefmost wins s[i].match[0] < pos { // earlier match already going; lefmost wins
return s; return s;
} }
} }
...@@ -801,8 +801,8 @@ func (re *Regexp) doExecute(str string, bytes []byte, pos int) []int { ...@@ -801,8 +801,8 @@ func (re *Regexp) doExecute(str string, bytes []byte, pos int) []int {
case _END: case _END:
// choose leftmost longest // choose leftmost longest
if !found || // first if !found || // first
st.match[0] < final.match[0] || // leftmost st.match[0] < final.match[0] || // leftmost
(st.match[0] == final.match[0] && pos > final.match[1]) { // longest (st.match[0] == final.match[0] && pos > final.match[1]) { // longest
final = st; final = st;
final.match[1] = pos; final.match[1] = pos;
} }
......
...@@ -195,8 +195,8 @@ func (s Close) send() { ...@@ -195,8 +195,8 @@ func (s Close) send() {
// A ReceivedUnexpected error results if no active Events match a value // A ReceivedUnexpected error results if no active Events match a value
// received from a channel. // received from a channel.
type ReceivedUnexpected struct { type ReceivedUnexpected struct {
Value interface{}; Value interface{};
ready []*Event; ready []*Event;
} }
func (r ReceivedUnexpected) String() string { func (r ReceivedUnexpected) String() string {
......
...@@ -314,9 +314,9 @@ func printCategories() { ...@@ -314,9 +314,9 @@ func printCategories() {
} }
fmt.Printf( fmt.Printf(
"// Generated by running\n" "// Generated by running\n"
"// maketables --tables=%s --data=%s\n" "// maketables --tables=%s --data=%s\n"
"// DO NOT EDIT\n\n" "// DO NOT EDIT\n\n"
"package unicode\n\n", "package unicode\n\n",
*tablelist, *tablelist,
*dataUrl); *dataUrl);
...@@ -591,8 +591,8 @@ func printScriptOrProperty(doProps bool) { ...@@ -591,8 +591,8 @@ func printScriptOrProperty(doProps bool) {
fmt.Printf( fmt.Printf(
"// Generated by running\n" "// Generated by running\n"
"// maketables --%s=%s --url=%s\n" "// maketables --%s=%s --url=%s\n"
"// DO NOT EDIT\n\n", "// DO NOT EDIT\n\n",
flag, flag,
flaglist, flaglist,
*url); *url);
...@@ -778,12 +778,12 @@ func printCases() { ...@@ -778,12 +778,12 @@ func printCases() {
} }
fmt.Printf( fmt.Printf(
"// Generated by running\n" "// Generated by running\n"
"// maketables --data=%s\n" "// maketables --data=%s\n"
"// DO NOT EDIT\n\n" "// DO NOT EDIT\n\n"
"// CaseRanges is the table describing case mappings for all letters with\n" "// CaseRanges is the table describing case mappings for all letters with\n"
"// non-self mappings.\n" "// non-self mappings.\n"
"var CaseRanges = _CaseRanges\n" "var CaseRanges = _CaseRanges\n"
"var _CaseRanges = []CaseRange {\n", "var _CaseRanges = []CaseRange {\n",
*dataUrl); *dataUrl);
var startState *caseState; // the start of a run; nil for not active var startState *caseState; // the start of a run; nil for not active
......
...@@ -475,7 +475,7 @@ func (p *Parser) RawToken() (Token, os.Error) { ...@@ -475,7 +475,7 @@ func (p *Parser) RawToken() (Token, os.Error) {
} }
switch b { switch b {
case '-': // <!- case '-': // <!-
// Probably <!-- for a comment. // Probably <!-- for a comment.
if b, ok = p.getc(); !ok { if b, ok = p.getc(); !ok {
return nil, p.err; return nil, p.err;
} }
...@@ -504,7 +504,7 @@ func (p *Parser) RawToken() (Token, os.Error) { ...@@ -504,7 +504,7 @@ func (p *Parser) RawToken() (Token, os.Error) {
return Comment(data), nil; return Comment(data), nil;
case '[': // <![ case '[': // <![
// Probably <![CDATA[. // Probably <![CDATA[.
for i := 0; i < 7; i++ { for i := 0; i < 7; i++ {
if b, ok = p.getc(); !ok { if b, ok = p.getc(); !ok {
return nil, p.err; return nil, p.err;
...@@ -1187,15 +1187,15 @@ var second = []unicode.Range{ ...@@ -1187,15 +1187,15 @@ var second = []unicode.Range{
// standard HTML entity characters. // standard HTML entity characters.
var HTMLEntity = htmlEntity var HTMLEntity = htmlEntity
var htmlEntity = map[string]string { var htmlEntity = map[string]string{
/* /*
hget http://www.w3.org/TR/html4/sgml/entities.html | hget http://www.w3.org/TR/html4/sgml/entities.html |
ssam ' ssam '
,y /\&gt;/ x/\&lt;(.|\n)+/ s/\n/ /g ,y /\&gt;/ x/\&lt;(.|\n)+/ s/\n/ /g
,x v/^\&lt;!ENTITY/d ,x v/^\&lt;!ENTITY/d
,s/\&lt;!ENTITY ([^ ]+) .*U\+([0-9A-F][0-9A-F][0-9A-F][0-9A-F]) .+/ "\1": "\\u\2",/g ,s/\&lt;!ENTITY ([^ ]+) .*U\+([0-9A-F][0-9A-F][0-9A-F][0-9A-F]) .+/ "\1": "\\u\2",/g
' '
*/ */
"nbsp": "\u00A0", "nbsp": "\u00A0",
"iexcl": "\u00A1", "iexcl": "\u00A1",
"cent": "\u00A2", "cent": "\u00A2",
...@@ -1454,11 +1454,11 @@ var htmlEntity = map[string]string { ...@@ -1454,11 +1454,11 @@ var htmlEntity = map[string]string {
// should be considered to close automatically. // should be considered to close automatically.
var HTMLAutoClose = htmlAutoClose var HTMLAutoClose = htmlAutoClose
var htmlAutoClose = []string { var htmlAutoClose = []string{
/* /*
hget http://www.w3.org/TR/html4/loose.dtd | hget http://www.w3.org/TR/html4/loose.dtd |
9 sed -n 's/<!ELEMENT (.*) - O EMPTY.+/ "\1",/p' | tr A-Z a-z 9 sed -n 's/<!ELEMENT (.*) - O EMPTY.+/ "\1",/p' | tr A-Z a-z
*/ */
"basefont", "basefont",
"br", "br",
"area", "area",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment