Skip to content

Instantly share code, notes, and snippets.

@danking
Created October 19, 2011 02:34
Show Gist options
  • Save danking/1297350 to your computer and use it in GitHub Desktop.
Save danking/1297350 to your computer and use it in GitHub Desktop.
deref ::= id LBRACK num RBRACK
| id DOT id
| id DOT foo
id . LBRACK num RBRACK
id . DOT id
id . DOT foo
id DOT . id
id DOT . foo
. id LBRACK num RBRACK
. id DOT id
. id DOT foo
id DOT id .
id . LBRACK num RBRACK
id . DOT id
id . DOT foo
f[1].d[2]
Should parse to:
(deref/recurse
(deref/array (id f) LBRACK 1 RBRACK)
DOT
(deref/array (id d) LBRACK 2 RBRACK))
not
(deref/recurse
(deref/array (id f) LBRACK 1 RBRACK)
DOT
(id d))
followed by an error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment