-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcodepath.ohm
More file actions
25 lines (25 loc) · 1021 Bytes
/
codepath.ohm
File metadata and controls
25 lines (25 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Codepath {
Reference = FilePath ("/" Segment)*
FilePath = Abs? PathComponent ("/" PathComponent)* "." Extension
Abs = "/"
PathComponent = PathChar+
PathChar = ~("/" | "[" | "]" | " " | ".") any
Extension = "ts" | "tsx" | "js" | "jsx"
Segment = Name Filter?
Filter = "[" (Index | PropertyFilter) "]"
Name = Identifier | Keyword
Keyword = "if" | "then" | "else"
| "for" | "forOf" | "forIn"
| "while" | "do"
| "switch" | "case" | "default"
| "try" | "catch" | "finally"
| "arrow" | "anon" | "block"
Identifier = loletter (loletter | digit)*
Index = digit+
PropertyFilter = PropName "=" Literal
PropName = "name" | "condition" | "callee" | "expression"
Literal = StringLiteral | NumericLiteral
StringLiteral = "\"" (~"\"" any)* "\""
NumericLiteral = digit+ ("." digit*)?
loletter = "_" | lower | upper
}