Skip to content

JonathanPicques/pegjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

81 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pegjs

PEGJS libraries for common use cases

Expression

Defines a grammar for arithmetical expressions and operations, identifiers, functions and literal types.

Defines

  • Expression
  • Identifier
  • Function
  • Literal (NullLiteral / ArrayLiteral / ObjectLiteral / NumberLiteral / StringLiteral / BooleanLiteral)

Operation precedence

Precedence Operator Associativity Description
0 (…) ... Grouping
1 ! … left-to-right Logical NOT
2 ~ … left-to-right Bitwise NOT
3 + … left-to-right Unary Plus
4 - … left-to-right Unary Negation
5 … ** … right-to-left Exponentiation
6 … * …
… / …
… % …
right-to-left Multiplication
Division
Remainder
7 … + …
… - …
right-to-left Addition
Subtraction
8 … << …
… >> …
… >>> …
right-to-left Bitwise Left Shift
Bitwise Right Shift
Bitwise Unsigned Right Shift
9 … < …
… <= …
… > …
… >= …
right-to-left Less Than
Less Than Or Equal
Greater Than
Greater Than Or Equal
10 … == …
… != …
… === …
… !== …
right-to-left Equality
Inequality
Strict Equality
Strict Inequality
11 … & … right-to-left Bitwise AND
12 … ^ … right-to-left Bitwise XOR
13 … | … right-to-left Bitwise OR
14 … && … right-to-left Logical AND
15 … || … right-to-left Logical OR
16 … ? … : …
… ?: …
left-to-right Conditional Ternary
Conditional Elvis

Type system

Defines a grammar for parsing code types with the following format: String{multiline: false} | Map<String, List<Boolean>>

Defines

  • UnionType
  • SingleType
  • SingleTypeTemplate

PostgREST

Defines a grammar for parsing simple postgrest queries with an excel-like format: OR(lastname = "Doe", NOT(firstname = "John"))

Defines

  • Postgrest

Unicode helpers

Defines a grammar for several unicode handy ranges (Not made to be accurate.)

Defines

  • __ (UnicodeWhitespace*)
  • UnicodeWhitespace
  • UnicodeLatinLetter
  • UnicodeLineTerminator
  • UnicodeLineTerminatorSequence

About

PEGJS libraries for common use cases

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published