Skip to content

Commit

Permalink
Add use strict to JS parsers
Browse files Browse the repository at this point in the history
  • Loading branch information
lierdakil committed Jun 6, 2020
1 parent 303605e commit f7746f7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Parser/LL/JS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ instance ParserWriter LLParser JS where
where
basename = parserOptionsBaseFileName
sourceFile = [interp|
'use strict'

const {TokenType, tokToStr} = require('./lexer.js')
#{topTop gtop}
const NonTerminal = {
Expand Down
2 changes: 2 additions & 0 deletions lib/Parser/LR/JS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ instance LRPoint p => ParserWriter (LRParser p) JS where
--writeParser :: Proxy lang -> Text -> ParserOptions a -> parser -> [(FilePath,Text)]
writeParser _ gtop ParserOptions{..} LRParser{..} = [
(base <> ".js", [interp|
'use strict'

const {TokenType, tokToStr} = require('./lexer.js')

#{topTop gtop}
Expand Down
2 changes: 2 additions & 0 deletions lib/Parser/Recursive/JS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import Parser.Recursive.Build
instance ParserWriter RecursiveParser JS where
writeParser _ gtop ParserOptions{..} RecursiveParser{..} =
[(basename <> ".js", [interp|
'use strict'

const {tokToStr, TokenType} = require('./lexer.js')
#{topTop gtop}
class #{parserOptionsName}#{topInh gtop} {
Expand Down

0 comments on commit f7746f7

Please sign in to comment.