Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@solidity-parser/parser

Package Overview
Dependencies
Maintainers
1
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solidity-parser/parser - npm Package Compare versions

Comparing version 0.11.1 to 0.12.0

1

dist/ast-types.d.ts

@@ -299,2 +299,3 @@ import { Token } from './types';

parts: string[];
isUnicode: boolean[];
}

@@ -301,0 +302,0 @@ export interface Identifier extends BaseASTNode {

2

package.json
{
"name": "@solidity-parser/parser",
"version": "0.11.1",
"version": "0.12.0",
"description": "A Solidity parser built from a robust ANTLR 4 grammar",

@@ -5,0 +5,0 @@ "main": "dist/index.cjs.js",

@@ -391,2 +391,3 @@ // Base on the original type definitions for solidity-parser-antlr 0.2

parts: string[]
isUnicode: boolean[]
}

@@ -393,0 +394,0 @@ export interface Identifier extends BaseASTNode {

@@ -546,9 +546,20 @@ import antlr4 from 'antlr4'

if (ctx.identifier() && toText(ctx.identifier()) !== 'Error') {
throw new Error('Expected "Error" identifier in catch clause')
if (
ctx.identifier() &&
toText(ctx.identifier()) !== 'Error' &&
toText(ctx.identifier()) !== 'Panic'
) {
throw new Error('Expected "Error" or "Panic" identifier in catch clause')
}
let kind = null;
if (ctx.identifier()) {
kind = toText(ctx.identifier())
}
return {
// deprecated, use the `kind` property instead,
isReasonStringType:
!!ctx.identifier() && toText(ctx.identifier()) === 'Error',
kind,
parameters,

@@ -1011,7 +1022,12 @@ body: (this as any).visit(ctx.block()),

if (ctx.stringLiteral()) {
const parts = ctx
const fragments = ctx
.stringLiteral()
.StringLiteralFragment()
.map((stringLiteralFragmentCtx: any) => {
const text = toText(stringLiteralFragmentCtx)
let text = toText(stringLiteralFragmentCtx)
const isUnicode = text.slice(0, 7) === 'unicode';
if (isUnicode) {
text = text.slice(7);
}
const singleQuotes = text[0] === "'"

@@ -1023,5 +1039,7 @@ const textWithoutQuotes = text.substring(1, text.length - 1)

return value
return { value, isUnicode }
})
const parts = fragments.map((x: any) => x.value)
return {

@@ -1031,2 +1049,3 @@ type: 'StringLiteral',

parts,
isUnicode: fragments.map((x: any) => x.isUnicode),
}

@@ -1291,2 +1310,3 @@ }

parts: [value],
isUnicode: [false] // assembly doesn't seem to support unicode literals right now
}

@@ -1336,2 +1356,3 @@ }

parts: [value],
isUnicode: [false], // assembly doesn't seem to support unicode literals right now
}

@@ -1338,0 +1359,0 @@ }

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc