Skip to content

Commit

Permalink
Tidier IDENT syntax (#86)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelocantos authored Aug 8, 2020
1 parent ec2202a commit ccc5b81
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ REF -> "%" IDENT ("=" default=STR)?;
COMMENT -> /{ //.*$
| (?s: /\* (?: [^*] | \*+[^*/] ) \*/ )
};
IDENT -> /{@|[A-Za-z_\.]\w*};
IDENT -> /{@|\.?[A-Za-z_]\w*};
INT -> \d+;
STR -> /{ " (?: \\. | [^\\"] )* "
| ' (?: \\. | [^\\'] )* '
Expand Down
2 changes: 1 addition & 1 deletion examples/wbnf.wbnf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ REF -> "%" IDENT ("=" default=STR)?;
COMMENT -> /{ //.*$
| (?s: /\* (?: [^*] | \*+[^*/] ) \*/ )
};
IDENT -> /{@|[A-Za-z_\.]\w*};
IDENT -> /{@|\.?[A-Za-z_]\w*};
INT -> \d+;
STR -> /{ " (?: \\. | [^\\"] )* "
| ' (?: \\. | [^\\'] )* '
Expand Down
3 changes: 2 additions & 1 deletion parser/scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ func (s Scope) ReplaceCutPoint(force bool) (newScope Scope, prev, replacement Cu
prev = s.GetCutPoint()
replacement = invalidCutpoint
if prev.valid() || force {
replacement = Cutpointdata(rand.Int31())
// TODO: What's with the random number?
replacement = Cutpointdata(rand.Int31()) //nolint:gosec
return s.With(cutpointkey, replacement), prev, replacement
}
return s, invalidCutpoint, invalidCutpoint
Expand Down
26 changes: 13 additions & 13 deletions wbnf/wbnfgrammar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ccc5b81

Please sign in to comment.