Skip to content

Commit

Permalink
Update regex terminals to match new syntax (#356)
Browse files Browse the repository at this point in the history
* Update regex to match new syntax

* Set Version: 0.2.53

---------

Co-authored-by: devops <[email protected]>
  • Loading branch information
Scott-Guest and devops authored May 9, 2024
1 parent 68fbdaf commit fec3d1a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions kmir/k-src/mir-lexer-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Primitive types (in literal format) used in MIR.
//TODO: locate the code defines the primitive types in MIR.
//Do we need to redefine regular expression? Maybe move to Type File
syntax UnsignedLiteral ::= r"[0-9]+_(usize|u8|u16|u32|u64|u128)" [token]
syntax SignedLiteral ::= r"[-]?[0-9]+_(isize|i8|i16|i32|i64|i128)" [token]
syntax SignedLiteral ::= r"-?[0-9]+_(isize|i8|i16|i32|i64|i128)" [token]
syntax FloatLiteral ::= r"-?[0-9]+(.[0-9]+)?((E|e)(\\+|-)?[0-9]+)?(f32|f64)" [token]
syntax HexLiteral ::= r"0x[0-9a-fA-F]+" [token]
syntax StringLiteral ::= r"[\\\"]([^\\\"\\\\\\n]|\\\\[\\\"'nrt0\\\\]|\\\\x[0-7][0-9a-fA-F]|\\\\u\\{[0-9a-fA-F]+\\}|\\\\u[0-9a-fA-F]([0-9a-fA-F]([0-9a-fA-F]([0-9a-fA-F]([0-9a-fA-F][0-9a-fA-F]?)?)?)?)?|\\\\\\n)*[\\\"]" [token, prec(-1)]
Expand Down Expand Up @@ -63,7 +63,7 @@ Types such as structs, tuples and unions, which has fields (indexed by `VariantI
```

```k
syntax AllocReferenceToken ::= r"#\\(-*alloc[0-9]+(?:\\+0x[0-9a-fA-F]+)?-*\\)#" [token]
syntax AllocReferenceToken ::= r"#\\(-*alloc[0-9]+(\\+0x[0-9a-fA-F]+)?-*\\)#" [token]
syntax DoubleHexDigitNoIntLetter ::= r"[a-fA-F][0-9a-fA-F]" [token]
syntax DoubleHexDigitNoIntDigit ::= r"[0-9][a-fA-F]" [token]
```
Expand Down
2 changes: 1 addition & 1 deletion kmir/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "kmir"
version = "0.2.52"
version = "0.2.53"
description = ""
authors = [
"Runtime Verification, Inc. <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion kmir/src/kmir/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from .kmir import KMIR

VERSION: Final = '0.2.52'
VERSION: Final = '0.2.53'
2 changes: 1 addition & 1 deletion package/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.52
0.2.53

0 comments on commit fec3d1a

Please sign in to comment.