Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1492)

Delta Between Two Patch Sets: src/cmd/godoc/spec.go

Issue 5236041: code review 5236041: godoc: user scanner instead of go/scanner for ebnf proc... (Closed)
Left Patch Set: diff -r 957ea35c7f91 https://go.googlecode.com/hg/ Created 13 years, 5 months ago
Right Patch Set: diff -r f2c56d5fa9ef https://go.googlecode.com/hg/ Created 13 years, 5 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/cmd/godoc/godoc.go ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2009 The Go Authors. All rights reserved. 1 // Copyright 2009 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package main 5 package main
6 6
7 // This file contains the mechanism to "linkify" html source 7 // This file contains the mechanism to "linkify" html source
8 // text containing EBNF sections (as found in go_spec.html). 8 // text containing EBNF sections (as found in go_spec.html).
9 // The result is the input source text with the EBNF sections 9 // The result is the input source text with the EBNF sections
10 // modified such that identifiers are linked to the respective 10 // modified such that identifiers are linked to the respective
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 162
163 // j: end of EBNF text (or end of source) 163 // j: end of EBNF text (or end of source)
164 j := bytes.Index(src[i:], closeTag) // close marker 164 j := bytes.Index(src[i:], closeTag) // close marker
165 if j < 0 { 165 if j < 0 {
166 j = len(src) - i 166 j = len(src) - i
167 } 167 }
168 j += i 168 j += i
169 169
170 // write text before EBNF 170 // write text before EBNF
171 out.Write(src[0:i]) 171 out.Write(src[0:i])
172 » » // parse and write EBNF 172 » » // process EBNF
173 var p ebnfParser 173 var p ebnfParser
174 p.parse(out, src[i:j]) 174 p.parse(out, src[i:j])
175 175
176 // advance 176 // advance
177 src = src[j:] 177 src = src[j:]
178 } 178 }
179 } 179 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b