From 22f67dbfc0a82e8bacddaa3945c197aacb5c5ffb Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 11 Apr 2023 18:16:30 -0500 Subject: [PATCH] [patch] Tweak read grammar to allow read(probe(x)) as in examples. (#93) This isn't really generally useful but might as well allow it as it's useful for examples (such as those in spec already!). Note you still can't `read(probe(x).y)` but not worth allowing when you might as well `read(probe(x.y))`. --- revision-history.yaml | 1 + spec.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/revision-history.yaml b/revision-history.yaml index e845ae9d..14fb7511 100644 --- a/revision-history.yaml +++ b/revision-history.yaml @@ -7,6 +7,7 @@ revisionHistory: - Fix typos in force/release examples, force takes expr not int literal. - Delineate string and single-quoted/double-quoted string in grammar. # Information about the old versions. This should be static. + - Tweak grammar of 'read' to support 'read(probe(x))' as in examples. oldVersions: - version: 2.0.1 changes: diff --git a/spec.md b/spec.md index fdfb6ef7..9cefa8fd 100644 --- a/spec.md +++ b/spec.md @@ -3557,7 +3557,7 @@ expr = ( "UInt" | "SInt" ) , [ width ] , "(" , int_any , ")" | reference | "mux" , "(" , expr , "," , expr , "," , expr , ")" - | "read" , "(" , static_reference , ")" + | "read" , "(" , ref_expr , ")" | primop ; static_reference = id | static_reference , "." , id