diff options
author | Robert Griesemer <gri@golang.org> | 2009-06-02 18:03:47 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2009-06-02 18:03:47 -0700 |
commit | 037c5bf6f69aef382a1222aed0ff69b829ae89a7 (patch) | |
tree | 06361714d6c999b877cc37c77208262f32428f2c /src/lib/datafmt/datafmt.go | |
parent | e3644f1194373bf5201dba02921c2387d2ed58d4 (diff) | |
download | golang-037c5bf6f69aef382a1222aed0ff69b829ae89a7.tar.gz |
change datafmt syntax to use '@' instead of '^' (to match
convention used in template.go)
R=rsc
DELTA=22 (3 added, 1 deleted, 18 changed)
OCL=29780
CL=29782
Diffstat (limited to 'src/lib/datafmt/datafmt.go')
-rw-r--r-- | src/lib/datafmt/datafmt.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/lib/datafmt/datafmt.go b/src/lib/datafmt/datafmt.go index baeb3ac41..7e0242479 100644 --- a/src/lib/datafmt/datafmt.go +++ b/src/lib/datafmt/datafmt.go @@ -78,10 +78,10 @@ A field operand is a field name optionally followed by an alternate rule name. The field name may be an identifier or one of the special - names ^ or *. + names @ or *. Field = FieldName [ ":" RuleName ] . - FieldName = identifier | "^" | "*" . + FieldName = identifier | "@" | "*" . If the field name is an identifier, the current value must be a struct, and there must be a field with that name in the struct. The same lookup @@ -91,8 +91,7 @@ and an error message is returned. (TODO consider changing the semantics such that if a field is not found, it evaluates to nil). - The special name '^' denotes the current value. (TODO see if ^ can - change to @ or be eliminated). + The special name '@' denotes the current value. The meaning of the special name '*' depends on the type of the current value: @@ -252,7 +251,7 @@ type ( literal [][]byte; // a list of string segments, possibly starting with '%' field struct { - fieldName string; // including "^", "*" + fieldName string; // including "@", "*" ruleName string; // "" if no rule name specified }; @@ -587,7 +586,7 @@ func (s *State) eval(fexpr expr, value reflect.Value, index int) bool { case *field: // determine field value switch t.fieldName { - case "^": + case "@": // field value is current value case "*": |