Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 239 for unquote (0.21 sec)

  1. src/strconv/quote.go

    	out, _, err := unquote(s, false)
    	return out, err
    }
    
    // Unquote interprets s as a single-quoted, double-quoted,
    // or backquoted Go string literal, returning the string value
    // that s quotes.  (If s is single-quoted, it would be a Go
    // character literal; Unquote returns the corresponding
    // one-character string.)
    func Unquote(s string) (string, error) {
    	out, rem, err := unquote(s, true)
    	if len(rem) > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 04 14:21:28 UTC 2024
    - 16.5K bytes
    - Viewed (0)
  2. src/regexp/exec_test.go

    		if strings.Contains(flag, "$") {
    			f := `"` + field[1] + `"`
    			if field[1], err = strconv.Unquote(f); err != nil {
    				t.Errorf("%s:%d: cannot unquote %s", file, lineno, f)
    			}
    			f = `"` + field[2] + `"`
    			if field[2], err = strconv.Unquote(f); err != nil {
    				t.Errorf("%s:%d: cannot unquote %s", file, lineno, f)
    			}
    		}
    
    		//   Field 2: the regular expression pattern; SAME uses the pattern from
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:36:03 UTC 2024
    - 20.7K bytes
    - Viewed (0)
  3. src/encoding/json/decode.go

    			c = c - 'A' + 10
    		default:
    			return -1
    		}
    		r = r*16 + rune(c)
    	}
    	return r
    }
    
    // unquote converts a quoted JSON string literal s into an actual string t.
    // The rules are different than for Go, so cannot use strconv.Unquote.
    func unquote(s []byte) (t string, ok bool) {
    	s, ok = unquoteBytes(s)
    	t = string(s)
    	return
    }
    
    // unquoteBytes should be an internal detail,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 35.3K bytes
    - Viewed (0)
  4. src/internal/fuzz/encoding.go

    			return nil, fmt.Errorf("expected []byte")
    		}
    		lit, ok := arg.(*ast.BasicLit)
    		if !ok || lit.Kind != token.STRING {
    			return nil, fmt.Errorf("string literal required for type []byte")
    		}
    		s, err := strconv.Unquote(lit.Value)
    		if err != nil {
    			return nil, err
    		}
    		return []byte(s), nil
    	}
    
    	var idType *ast.Ident
    	if selector, ok := call.Fun.(*ast.SelectorExpr); ok {
    		xIdent, ok := selector.X.(*ast.Ident)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 16:39:12 UTC 2022
    - 11K bytes
    - Viewed (0)
  5. src/cmd/compile/internal/types2/check_test.go

    					panic("unreachable")
    				}
    			}
    			unquoted, err := strconv.Unquote(strings.TrimSpace(pattern))
    			if err != nil {
    				t.Errorf("%s:%d:%d: invalid ERROR pattern (cannot unquote %s)", filename, line, want.Pos.Col(), pattern)
    				continue
    			}
    			if substr {
    				if !strings.Contains(gotMsg, unquoted) {
    					continue
    				}
    			} else {
    				rx, err := regexp.Compile(unquoted)
    				if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:45:33 UTC 2024
    - 13.8K bytes
    - Viewed (0)
  6. src/text/template/parse/parse.go

    // been scanned.
    func (t *Tree) parseDefinition() {
    	const context = "define clause"
    	name := t.expectOneOf(itemString, itemRawString, context)
    	var err error
    	t.Name, err = strconv.Unquote(name.val)
    	if err != nil {
    		t.error(err)
    	}
    	t.expect(itemRightDelim, context)
    	var end Node
    	t.Root, end = t.itemList()
    	if end.Type() != nodeEnd {
    		t.errorf("unexpected %s in %s", end, context)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:57:51 UTC 2024
    - 21.3K bytes
    - Viewed (0)
  7. src/cmd/go/internal/modindex/build_read.go

    		if !ok {
    			continue
    		}
    		for _, dspec := range d.Specs {
    			spec, ok := dspec.(*ast.ImportSpec)
    			if !ok {
    				continue
    			}
    			quoted := spec.Path.Value
    			path, err := strconv.Unquote(quoted)
    			if err != nil {
    				return fmt.Errorf("parser returned invalid quoted string: <%s>", quoted)
    			}
    			if path == "embed" {
    				hasEmbed = true
    			}
    
    			doc := spec.Doc
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 23 10:10:21 UTC 2023
    - 13K bytes
    - Viewed (0)
  8. src/go/types/check_test.go

    					panic("unreachable")
    				}
    			}
    			unquoted, err := strconv.Unquote(strings.TrimSpace(pattern))
    			if err != nil {
    				t.Errorf("%s:%d:%d: invalid ERROR pattern (cannot unquote %s)", filename, line, want.col, pattern)
    				continue
    			}
    			if substr {
    				if !strings.Contains(gotMsg, unquoted) {
    					continue
    				}
    			} else {
    				rx, err := regexp.Compile(unquoted)
    				if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 19:45:33 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  9. src/cmd/asm/internal/lex/input.go

    // #include processing.
    func (in *Input) include() {
    	// Find and parse string.
    	tok := in.Stack.Next()
    	if tok != scanner.String {
    		in.expectText("expected string after #include")
    	}
    	name, err := strconv.Unquote(in.Stack.Text())
    	if err != nil {
    		in.Error("unquoting include file name: ", err)
    	}
    	in.expectNewline("#include")
    	// Push tokenizer for file onto stack.
    	fd, err := os.Open(name)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Aug 29 07:48:38 UTC 2023
    - 12.6K bytes
    - Viewed (0)
  10. src/cmd/go/internal/generate/generate.go

    				switch c {
    				case '\\':
    					if i+1 == len(line) {
    						g.errorf("bad backslash")
    					}
    					i++ // Absorb next byte (If it's a multibyte we'll get an error in Unquote).
    				case '"':
    					word, err := strconv.Unquote(line[0 : i+1])
    					if err != nil {
    						g.errorf("bad quoted string")
    					}
    					words = append(words, word)
    					line = line[i+1:]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 29 19:39:24 UTC 2024
    - 14.5K bytes
    - Viewed (0)
Back to top