shiftTest{1, 100, "1267650600228229401496703205376"},
shiftTest{1, -100,
"0.00000000000000000000000000000078886090522101180541"
- "17285652827862296732064351090230047702789306640625",
+ "17285652827862296732064351090230047702789306640625",
},
shiftTest{12345678, 8, "3160493568"},
shiftTest{12345678, -8, "48225.3046875"},
// The representation of a compiled regular expression.
// The public interface is entirely through methods.
type Regexp struct {
- expr string; // the original expression
+ expr string; // the original expression
inst []instr;
start instr;
nbra int; // number of brackets in expression, for subexpressions
// The other functions (closure(), concatenation() etc.) assume
// it's safe to recur to here.
if p.error != "" {
- return
+ return;
}
switch c := p.c(); c {
case '|', endOfFile:
p.nextc();
start = p.charClass();
if p.error != "" {
- return
+ return;
}
if p.c() != ']' {
p.error = ErrUnmatchedLbkt;
for {
nstart, nend := p.closure();
if p.error != "" {
- return
+ return;
}
switch {
case nstart == nil: // end of this concatenation
func (p *parser) regexp() (start, end instr) {
start, end = p.concatenation();
if p.error != "" {
- return
+ return;
}
for {
switch p.c() {
p.nextc();
nstart, nend := p.concatenation();
if p.error != "" {
- return
+ return;
}
alt := new(_Alt);
p.re.add(alt);
// go in order correctly and this "earlier" test is never necessary,
for i := 0; i < l; i++ {
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;
}
}
case _END:
// choose leftmost longest
if !found || // first
- st.match[0] < final.match[0] || // leftmost
- (st.match[0] == final.match[0] && pos > final.match[1]) { // longest
+ st.match[0] < final.match[0] || // leftmost
+ (st.match[0] == final.match[0] && pos > final.match[1]) { // longest
final = st;
final.match[1] = pos;
}
// A ReceivedUnexpected error results if no active Events match a value
// received from a channel.
type ReceivedUnexpected struct {
- Value interface{};
- ready []*Event;
+ Value interface{};
+ ready []*Event;
}
func (r ReceivedUnexpected) String() string {
}
fmt.Printf(
"// Generated by running\n"
- "// maketables --tables=%s --data=%s\n"
- "// DO NOT EDIT\n\n"
- "package unicode\n\n",
+ "// maketables --tables=%s --data=%s\n"
+ "// DO NOT EDIT\n\n"
+ "package unicode\n\n",
*tablelist,
*dataUrl);
fmt.Printf(
"// Generated by running\n"
- "// maketables --%s=%s --url=%s\n"
- "// DO NOT EDIT\n\n",
+ "// maketables --%s=%s --url=%s\n"
+ "// DO NOT EDIT\n\n",
flag,
flaglist,
*url);
}
fmt.Printf(
"// Generated by running\n"
- "// maketables --data=%s\n"
- "// DO NOT EDIT\n\n"
- "// CaseRanges is the table describing case mappings for all letters with\n"
- "// non-self mappings.\n"
- "var CaseRanges = _CaseRanges\n"
- "var _CaseRanges = []CaseRange {\n",
+ "// maketables --data=%s\n"
+ "// DO NOT EDIT\n\n"
+ "// CaseRanges is the table describing case mappings for all letters with\n"
+ "// non-self mappings.\n"
+ "var CaseRanges = _CaseRanges\n"
+ "var _CaseRanges = []CaseRange {\n",
*dataUrl);
var startState *caseState; // the start of a run; nil for not active
}
switch b {
case '-': // <!-
- // Probably <!-- for a comment.
+ // Probably <!-- for a comment.
if b, ok = p.getc(); !ok {
return nil, p.err;
}
return Comment(data), nil;
case '[': // <![
- // Probably <![CDATA[.
+ // Probably <![CDATA[.
for i := 0; i < 7; i++ {
if b, ok = p.getc(); !ok {
return nil, p.err;
// standard HTML entity characters.
var HTMLEntity = htmlEntity
-var htmlEntity = map[string]string {
-/*
- hget http://www.w3.org/TR/html4/sgml/entities.html |
- ssam '
- ,y /\>/ x/\<(.|\n)+/ s/\n/ /g
- ,x v/^\<!ENTITY/d
- ,s/\<!ENTITY ([^ ]+) .*U\+([0-9A-F][0-9A-F][0-9A-F][0-9A-F]) .+/ "\1": "\\u\2",/g
- '
-*/
+var htmlEntity = map[string]string{
+ /*
+ hget http://www.w3.org/TR/html4/sgml/entities.html |
+ ssam '
+ ,y /\>/ x/\<(.|\n)+/ s/\n/ /g
+ ,x v/^\<!ENTITY/d
+ ,s/\<!ENTITY ([^ ]+) .*U\+([0-9A-F][0-9A-F][0-9A-F][0-9A-F]) .+/ "\1": "\\u\2",/g
+ '
+ */
"nbsp": "\u00A0",
"iexcl": "\u00A1",
"cent": "\u00A2",
// should be considered to close automatically.
var HTMLAutoClose = htmlAutoClose
-var htmlAutoClose = []string {
-/*
- hget http://www.w3.org/TR/html4/loose.dtd |
- 9 sed -n 's/<!ELEMENT (.*) - O EMPTY.+/ "\1",/p' | tr A-Z a-z
-*/
+var htmlAutoClose = []string{
+ /*
+ hget http://www.w3.org/TR/html4/loose.dtd |
+ 9 sed -n 's/<!ELEMENT (.*) - O EMPTY.+/ "\1",/p' | tr A-Z a-z
+ */
"basefont",
"br",
"area",